화살표를 클릭하면 내 사이트가 아래로 스크롤됩니다. 여기에서 볼 수 있습니다. http://www.divisionforty.com/dbarr/jQuery 스크롤이 작동하지 않습니다.
그러나 어떤 이유로 클릭 할 때 아무런 변화가 없습니다. 그것은 전혀 작동하지 않습니다. 나는 더 나은 행운을 다른 divs에서 시도했습니다.
<script>
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
</script>
누군가 도움을 바랍니다.
감사합니다,
덴버
'target.length'을 확인하면 콘솔에서 코드를 실행하는 몇 개의 링크에 대한 빠른 테스트는 '0'을 반환합니다. 중단 점을 설정하고 코드를 단계별로 실행하십시오. – charlietfl