Trigger $(window).scroll(); Trigger $(window).scroll(); javascript javascript

Trigger $(window).scroll();


Apply it to both body and html as it is not consistent.. (for example, FF uses the html for scrolling while chrome uses the body)

$("html, body").animate({scrollTop: someValue});

demo at http://jsfiddle.net/vzyVh/


You can try below code - here i am scrolling to top of my div tag which has id "one".

$('html,body').animate({ scrollTop: $('#one').offset().top }, 'slow');