Is there a way to programmatically scroll to the top of a page with jQuery? I am currently trying to do this with the following code but it is not working. I am using Firefox currently,
$(window).scrollTop($(document).height());
Is there a way to programmatically scroll to the top of a page with jQuery? I am currently trying to do this with the following code but it is not working. I am using Firefox currently,
$(window).scrollTop($(document).height());
Try this:
$('html, body').animate({scrollTop: '0px'}, 300);
You can do this with 0 instead of 300 to be instant, but this gives a quick auto-scroll effect.