Trigger the code and jump to the top
Is what happens. If someone links to # then they probably built a JavaScript or otherwise handler into the link click.
Now your thinking, I KNOW! You need a floating Div at the top with the anchor on it, so when they goto the anchor, the page doesn’t move?
But it’s simpler than that, all you need it a bit of CSS.
1 2 3 | #javascriptLink a{ cursor:pointer; } |
and that bit of HTML
1 2 3 | <div id="javascriptLink"> <a onclick="JSFunctionHere"> </div> |
and the javascript
1 2 3 | function JSFunctionHere(){ } |
See?
