Scroll to specific div on page load
$(document).ready(function(){
$("html, body").animate({
scrollTop: $('.sb-menu').offset().top
}, 1000);
});
You can do this using the .animate()
method:
$(document).ready(function () {
// Handler for .ready() called.
$('html, body').animate({
scrollTop: $('#what').offset().top
}, 'slow');
});
- This will smooth scroll to the div with ID
what
FIDDLE