12
rated 0 times
[
18]
[
6]
/ answers: 1 / hits: 41052
/ 12 Years ago, tue, august 21, 2012, 12:00:00
I am trying to use jQuery to scroll the page automatically back to the top when the page is loaded.
Here is my code:
<script type=text/javascript>
$(document).ready(function () {
$(window).scrollTop(0);
return false;
});
</script>
However, the code does not work.
I have also tried to replace $(window)
to $('html, body')
,
sadly it still does not work.
So could anyone advice on this?
Thanks a lot!
More From » jquery