acidglitter Posted August 19, 2008 Share Posted August 19, 2008 i'm working on this online store, and when you're looking through a category, to get to the next page, the next link is like <a href="" onclick="browsecategories();return false;">next</a>. then that javascript function uses ajax to load another page that loads the next page of products. the problem i'm having with this is for people with smaller monitors. they'll click the next link, and instead of the window going to the top of the list of products, it stays where it is. what i want it to do is go to the top of the list everytime you click next. does anyone know how i can do that? Quote Link to comment Share on other sites More sharing options...
lemmin Posted August 19, 2008 Share Posted August 19, 2008 linking to a blank anchor should do that: <a href="#" onclick="browsecategories();return false;">next< /a > Quote Link to comment Share on other sites More sharing options...
acidglitter Posted August 19, 2008 Author Share Posted August 19, 2008 i actually have the # right now, but with return false the browser doesn't actually go to page.php# Quote Link to comment Share on other sites More sharing options...
lemmin Posted August 19, 2008 Share Posted August 19, 2008 Yeah, I didn't mean to leave that in there. Why do you want to keep the return false if you DO want the link followed? It should do exactly what you want if you remove it. Quote Link to comment Share on other sites More sharing options...
acidglitter Posted August 25, 2008 Author Share Posted August 25, 2008 i don't want the link followed. it gets to the next page with a javascript function. i just want the browser window to move higher up on the page. Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted August 25, 2008 Share Posted August 25, 2008 <a href="javascript:scroll(0,0);void(0);" onclick="browsecategories();return false;">next</a> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.