2015년 1월 26일 월요일

scrolltop

<div id="target"></div>
<a href="#target" class="scroll">Scroll to target</a>
<script>
jQuery(document).ready(function($) {
        $(".scroll").click(function(event){  
                event.preventDefault();
                $('html,body').animate({scrollTop:$(this.hash).offset().top}, 500);
        });
});
</script>

댓글 없음:

댓글 쓰기