图像映射图像在IE中不能完全点击 [英] Image mapped image not fully clickable in IE
问题描述
我的网页上有以下代码(以及匿名链接已被修改)...
$ p $ < a href =http://www.page1.com>< img usemap =#termsclickablesrc =picture.png/>< / a>
< map id =termsclickablename =termsclickable>
< area shape =rectcoords =750,376,938,409target =_ blankhref =http://www.page2.comalt =title =/>
< / map>
在Chrome和Firefox中,我可以点击矩形坐标外的任何地方,然后转到page1,点击合作伙伴并获取第2页,但在IE中没有任何反应,当我点击合作伙伴之外。
奇怪的是,如果我点击右键点击'打开链接'就可以了。
有没有人看过这种奇怪的行为并知道解决方法?或者可能是我的语法错了?
我会回答我自己的问题,以便其他人可以来这里得到答案。
正如@Pete建议的那样,我需要定义另一个区域来合成整个图像,然后在我的图像映射中最后列出它。
< a href =http://www.page1.com>< img usemap =#termsclickablesrc = picture.png/>< / a>
< map id =termsclickablename =termsclickable>
< area shape =rectcoords =750,376,938,409target =_ blankhref =http://www.page2.comalt =title =/>
< area shape =rectcoords =0,0,650,950href =http://www.page1.com/>
< / map>
I have the following code (well, with links altered for anonymity) in my page...
<a href="http://www.page1.com" ><img usemap="#termsclickable" src="picture.png" /></a>
<map id="termsclickable" name="termsclickable">
<area shape="rect" coords="750,376,938,409" target="_blank" href="http://www.page2.com" alt="" title="" />
</map>
In Chrome and Firefox I can click anywhere outside the rectangle co-ordinates and be taken to page1, and click within the co-ords and get page 2, but in Internet Explorer nothing happens when I click outside the co-ords.
What's odd is that if I right click and click 'Open link' it works.
Has anyone seen this odd behaviour before and knows of a workaround? Or perhaps something wrong with my syntax?
I am going to answer my own question so that others can come here to get an answer.
As suggested by @Pete I need to define another area that encompases the whole image, and then list it last in my image map....
<a href="http://www.page1.com" ><img usemap="#termsclickable" src="picture.png" /></a>
<map id="termsclickable" name="termsclickable">
<area shape="rect" coords="750,376,938,409" target="_blank" href="http://www.page2.com" alt="" title="" />
<area shape="rect" coords="0,0,650,950" href="http://www.page1.com" />
</map>
这篇关于图像映射图像在IE中不能完全点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!