Web
jQuery animate를 이용한 자동 스크롤
mingoon.com
2021. 6. 1. 10:41
반응형
특정 Element로 자동으로 스크롤하고 싶을 때
function scrollTo(selector) {
$('html, body').animate({
scrollTop: parseInt($( selector ).offset().top)
}, 500);
}
동작하지 않는 경우, body에 아래 CSS를 추가해 본다.
height: auto;
min-height: 100%;