@rtretheweyMar 15.2013 — #If you use <a href="#"> and there's no onclick() function (and/or the user is running with JavaScript disabled), the browser will correctly consider the link to be pointing to the top of the current document. There's no way around that except to add an onclick() function or remove the 'href' attribute entirely.
@jedaisoulMar 16.2013 — #Why would you use href="#" and not want it to jump to the top? That is what it does!!! Are you using anchors as the target of links, because they could be named. If so, that is obsolete. Use ID="target" attribute in any div etc...
@davidwhiteauthorMar 18.2013 — #Why would you use href="#" and not want it to jump to the top? That is what it does!!! Are you using anchors as the target of links, because they could be named. If so, that is obsolete. Use ID="target" attribute in any div etc...[/QUOTE]
Yes I think that's what I'm doing. I'm a bit new to this.
I am using href="#" to link to somewhere on the same page, not another page.
So it's like:
<a href="#name1">My text</a> to click on
then
<div id="name1"> for the place where the link is.
I have DIVs with hidden content which only show when you go to them.
I just want to link internally to them on the same page without it making the page jump and scroll to the top which is annoying.
@jedaisoulMar 19.2013 — #Some possible reasons why this is happening:
a) The browser: which browser/version are you using?
b) The href and ID: Are you sure they match EXACTLY?
c) How are you making the hidden text appear/disappear?
Try disabling the code hiding/revealing the text and see if the page jumps to the top still. If not it's the code doing the hide/reveal which is causing it.