페이지를 아래로 내리면 TOP 버튼이 나와서 누르면 최상단으로 이동하는 버튼구현 TOP $(document).ready( function(){ //따라다니는 TOP버튼 $(window).on("scroll touchmove mousewheel DOMMouseScroll", function(e) { if($(window).scrollTop() >= 20) $(".btn_gotop").fadeIn(); else $(".btn_gotop").fadeOut(); }); $(".btn_gotop").click(function(){ $("html,body").animate({ scrollTop: 0 }, "fast"); }); }); ...
#
jquery
#
top버튼
원문 링크 : 따라다니는 TOP 버튼