페이지의 다음 섹션으로 이동하는 앵커 요소를 사용하여 테스트 웹 사이트를 만들고 있습니다. 사용자가 앵커에서을 (를) 클릭하면 왜 내 애니메이션이 표시되지 않는지 파악할 수 없습니다.스크롤링 애니메이션이 작동하지 않습니다.
$(function() {
$('a[href*=#]').on('click', function(e) {
e.preventDefault();
$('html, body').animate({ scrollTop: $($(this).attr('href')).offset().top}, 2000);
});
});
<head>
<link href="https://fonts.googleapis.com/css?family=Rokkitt" rel="stylesheet">
</head>
<body>
<header>
<h1 id="section00" class="siteName selector">Travel More</h1>
<h2 class="downPage"><a href="#section01" class="down1">∨</a></h2>
</header>
<section id="section01" class="content selector"><a href="#section02" class="down1">Second</a></section>
<section id="section02" class="content selector">
<a class="down1" href="#section03">Third</a>
</section>
<section id="section03" class="content selector">
<a class="down1" href="#section00">Last</a>
</section>
<footer><p>Travel More 2016</p></footer>
</body>
This is a link to the code (codepen)
당신이 HTML을 제공 할 수 있습니까? – osmanraifgunes