I have a jQuery menu which is build up by like this:
<h3 id='300' rel='default.aspx?PageID=300#300'>Item0</h3>
<h3 id='301' rel='default.aspx?PageID=301#301'>Item1</h3>
<h3 id='302' rel='default.aspx?PageID=302#302'>Item2</h3>
The problem is that it triggers anchor functionallity and makes
the page jump/scroll down to the clicked menu point.
How can I prevent this?
Best regards.
Have you ever heard of links? They are this really awesome thing in HTML.
Anyway, once you’ve changed each to:
Then just add
return false;at the end of your click handler to override the functionality.On the actual page, then make sure there isn’t anything with ID 300. It’s not a valid ID anyway, so you shouldn’t have any anyway.