Return to top of page - Ajax paging

Return to top of page - Ajax paging

Postby admin » Sat Apr 03, 2010 6:16 pm

A few comments recently have brought up the issue where click through category pages the page always stays at the bottom so the user has to scroll back up to the top to see the items on the new page.

A simple bit of code can be used to fix this and improve the customer experience.

How to fix it

In /includes/js/ans_ajax.js

find the line:

Code: Select all
function ajaxUpdater(id,url) {


below it add:

Code: Select all
window.scrollTo(0,0);


Now when the page numbers, next or previous are clicked the page is scrolled to the top and the new page content is still loaded via an ajax call :)
User avatar
admin
Site Admin
 
Posts: 462
Joined: Sun Nov 22, 2009 7:24 pm

Re: Return to top of page - Ajax paging

Postby twitch » Wed Apr 07, 2010 3:16 pm

This isnt working for me I added to my game site and it only jumps up an inch or so. any suggestions?
twitch

 
Posts: 254
Joined: Sat Feb 20, 2010 12:09 am

Re: Return to top of page - Ajax paging

Postby admin » Wed Apr 07, 2010 3:33 pm

try clearing your browser cache or do a full refresh. I had the same issue but it is now working for me, tested on IE7+, FF3 & Chrome.
User avatar
admin
Site Admin
 
Posts: 462
Joined: Sun Nov 22, 2009 7:24 pm


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 1 guest

cron