If you want to smoothly scroll to an element using jQuery its pretty easy. Heres how:
$("#button").click(function() {
$('html, body').animate({
scrollTop: $("#elementtoScrollToID").offset().top-50px
}, 2000);
});
Related External Links:
If you want to smoothly scroll to an element using jQuery its pretty easy. Heres how:
$("#button").click(function() {
$('html, body').animate({
scrollTop: $("#elementtoScrollToID").offset().top-50px
}, 2000);
});
Related External Links:
Article Topic:Software Development - Javascript
Date:May 11, 2015
Want me to help develop your next Ruby-on-Rails project or application?
Contact Me