jquery - Scroll to specific div on page load -


i'm trying figure out how page automaticlly scroll specific div when page has loaded. have tried using jquery scroll function, cant work correctly. suggestions?

following have tried far:

jquery(function() { jquery(window).scrolltop(jquery('.container').offset().top); }); 

you can using .animate() method:

$(document).ready(function () {     // handler .ready() called.     $('html, body').animate({         scrolltop: $('#what').offset().top     }, 'slow'); }); 
  • this smooth scroll div id what

fiddle


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -