Hei Hei - 2 years ago 78
Javascript Question

Auto scroll top when page loaded using jQuery

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 () {

return false;


However, the code does not work.
I have also tried to replace
$('html, body')
sadly it still does not work.

So could anyone advice on this?
Thanks a lot!

Answer Source

Try this

<script type="text/javascript">
    $(document).ready(function () {

The parameters 0,0 are the x and y coördinates.

I hope it helps.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download