이 코드는 내 머리글에 페이지를 특정 앵커로 스크롤하지만이 코드는 모든 내 페이지를 스크롤합니다. 내 HomePage에 예외를 추가하고 싶습니다. 내가 어떻게 할 수 있니? 고마워! 당신은 코드가 특정 페이지에서 작동하지 않는 경우스크롤에 예외 추가
//this code is between <head> tags in my header file.
<script
function scroll(){
$('html, body').animate({
scrollTop: $('#scroll').offset().top
}, 1000);
}
</script>
//this code is at the bottom of the page in my header file
//anchor
<a href="#scroll" id="scroll"></a>
//this code is in the header file
//called
<body onload="scroll()">
흠 ... 홈페이지에 코드를 추가하지 않으시겠습니까? – AJPerez
CMS를 사용하고 있습니까? 아니면 다른 응용 프로그램? – Alex
나는 워드 프레스를 사용 중입니다 –