scrollTop jQuery 2016. 8. 17. 10:25
방법1.
$("html, body").animate({ "scrollTop" : target }, 500);
$(document).delegate('#scrollTop', 'click', function () {
	$('html, body').stop().animate({ scrollTop : 0 }, 500);
	return false;
});


방법2.
$.mobile.silentScroll(100);
<script src="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

$("#scrollTop").click(function(){
	setInterval(function(){
		$.mobile.silentScroll(Math.random()*document.body.scrollHeight);
	}, 500);
});

참고 사이트 : https://api.jquerymobile.com/jquery.mobile.silentscroll/

'jQuery' 카테고리의 다른 글

Datepicker 년,월 선택  (0) 2019.06.20
iframe에서 부모 element에 접근하기  (0) 2016.05.12
z-index ie7에서 엘리먼트에 가려질 때  (0) 2013.05.08
Datepicker 옵션  (0) 2013.01.16
동적으로 li 추가, 삭제하기  (0) 2012.10.18