Tuesday, May 3, 2011

Scroll page to top after AJAX request or other actions

After loading page 2 or any other page in a list using AJAX, the browser must be scrolled to top.

<a href="http://www.blogger.com/list.html#page=2" onclick="window.scroll(0,0)">2</a>

window.scroll(0,0) - scroll to top command

PS: For example Google Analytics lists leave the page unscrolled after loading a new page from the list.

No comments: