Possible to stop page jumping when # link is used?
When I use an <a href> link internally with #, the page jumps to the top. Is there any way to stop this?
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...
Yes I think that's what I'm doing. I'm a bit new to this.
Originally Posted by jedaisoul
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
<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.
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.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)