다른페이지로 이동후 anchor 이동방법. 다시 질문드려요. 채택완료
우선 index.php 페이지에
-
<--여기에 링크
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
page/a.php 페이지에
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
이런식으로 html를 넣어서 테스트해보는데 다른페이지로 이동하면서 앵커에 포커싱이 되지 않네요..
제가 어떤 실수를 한것일까요? 그냥 html에서 심플하게
다른페이지 앵커 이동 ㅡㅡㅡㅡ 위치 이동 고수님들 답변 부탁드립니다.
답변 3개
답변에 대한 댓글 6개
http://xxxxxx.com/theme/테마명/page/artists.php#p1
이렇게 표시되면서 맨 상단으로 포커싱이 됩니다.
[code]
jQuery(document).ready(function () {
var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
if (window.location.hash && isChrome) {
setTimeout(function () {
var hash = window.location.hash;
window.location.hash = "";
window.location.hash = hash;
}, 300);
}
});
[/code]
참조 : https://community.wpbeaverbuilder.com/t/anchor-links-to-another-page-not-working-in-chrome/10557/8
알려주신 스크립트 사용하니 우선 크롬 엣지에서는 잘 됩니다.
정말 고맙습니다.
우선 잘 몰라서 index.php와 해당페이지에 같이 넣었습니다.
원래 대로라면 옮기는 페이지에만 있으면 되겠네요
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인