[Javascript] [RESOLVED BUT NOT UNDERSTOOD] Anchor tags not working
Paul Novitski
paul at novitskisoftware.com
Mon Mar 6 09:03:55 CST 2006
>On Mon, 6 Mar 2006 03:12:11 -0600
> "Fraser Baker" <flbaker at sbcglobal.net> wrote:
>>Changing the order in which the DIVs are loaded impacts the functionality of
>>the ANCHOR tags. By juggling the order, I was able to get all the anchors
>>working. Makes me nervous though. Any insight into what is going on?
At 05:12 AM 3/6/2006, Mike Dougherty wrote:
>Do you have duplicate ID? By changing the source order of the DIV,
>you are changing the relational order of their contents - perhaps
>your getElementById() call is reaching only the first of two
>elements? Keep in mind that IE treats name attributes as ID (yeah,
>it's dumb but what can you do)
Fraser,
Another thing to look for is a block element (such as a div) that's
been allowed to overlay the anchor.
This might be a div that comes after the anchor in the markup but is
positioned above it in the layout ("above" in the sense of closer to
the visitor's eye, not necessarily closer to the top of the
page). Check for following block elements with position: relative or
position: absolute and a higher z-index than your anchor. (A common
way of deliberately disabling hyperlinks and form controls is to
cover them with a transparent sheet of glass so they're visible but
can't be touched by the mouse.)
Also, I've found in the past that IE tends to mess up anchors when
they're positioned absolutely, but I don't have documentation of that
bug at my fingertips.
Paul
More information about the Javascript
mailing list