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
Comments
Post a Comment