PDA

View Full Version : Clickable map linked to same-page anchors doesn't work in IE5.5, IE6


mpclubfoot
01-22-2003, 05:56 PM
Greetings,

I have a clickable image that links to anchors within the same page. The html below works fine in IE5 but doesn't work in IE5.5 or IE6.

<map name="myMap">
<area shape="circle" coords="x1,y1,r1" href="anchor1">
<area shape="circle" coords="x2,y2,r2" href="anchor2">
</map>

The only article I could find in the MSKB (http://support.microsoft.com/) (Q274586, if you're interested) about anchors is actually about linking from one frame to anchors in another. Thinking, "what have I got to lose?", I tried the suggested work around using the scrollIntoView() object method. My ScrollTo() function is located in an external JS file. Again, this html works in IE5 but not in IE5.5 or IE6.

function ScrollTo(name)
{document.anchors.item(name).scrollIntoView();}


<map name="myMap">
<area shape="circle" coords="210,149,16"href="javascript:ScrollTo('anchor1')">
<area shape="circle" coords="293,230,16"
href="javascript:ScrollTo('anchor2')">
</map>

Any ideas as to why neither of these work? Thanks in advance...

cg9com
01-22-2003, 07:02 PM
<a href="#name">text</a>

<a name="name">text</a>

mpclubfoot
01-22-2003, 09:46 PM
I think you're asking whether I had named my anchors with or without #'s (I may be wrong). However, your reply made me realize that my anchors were empty, e.g. <a name="anchor"></a>. This worked fine in IE5 but apparently doesn't work any longer. I placed my target text within the anchors and the whole thing works like a charm.

I don't know if this is what you were suggesting, or not. If so, thanks. If not, I still want to say thanks because your response did lead me to the solution.

Cheers!

cg9com
01-22-2003, 10:22 PM
oh i see, i was suggesting a way to link to another section on the same page, glad you worked it out, thats another way of going about it hehe