Sunday, September 22, 2013

SMOOTHLY SCROLL TO AN ELEMENT WITHOUT A JQUERY PLUGIN


 This jquery script provide a way to scroll to move at paticular element of html and scrolling page with animation effect.

code snippet to scroll to paticular position:

<script>
$('html, body').animate({
scrollTop: $("#elementID").offset().top
}, 2000);
</script>

code snippet to scroll to Top:

$('.top').click(function (e) {
    e.preventDefault();
    $('html, body').animate(   scrollTop: 0
    });
});


Download      View Demo

No comments:

Post a Comment