ahschmidt Posted April 25, 2011 Share Posted April 25, 2011 I have a page with some Jquery that filters a list. When you click one of the items on the list, the page jumps to the top if it was scrolled slightly. Any ideas how I can prevent this behavior?Here is the page where it is happening: http://www.ahschmidt.com/dev/v2/To recreate the problem, scroll down the page slightly, and click one of the filter items above the list. The page will jump to the top of the scroll region. Thanks! Link to comment Share on other sites More sharing options...
justsomeguy Posted April 25, 2011 Share Posted April 25, 2011 Set the href to "javascript:void(0)". Link to comment Share on other sites More sharing options...
ahschmidt Posted April 26, 2011 Author Share Posted April 26, 2011 Thanks JSG! That works great. So it is trying to call a empty JS function, thus not reloading the page? Link to comment Share on other sites More sharing options...
justsomeguy Posted April 26, 2011 Share Posted April 26, 2011 Right, it executes a non-operation. When you set the href to # you're telling it to jump to a particular place on the page. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.