1
<img src="images/imagemap.png" width="600" height="100" border="0" usemap="#map" />

<map name="map">
<!-- #$-:Image map file created by GIMP Image Map plug-in -->
<!-- #$-:GIMP Image Map plug-in by Maurits Rijk -->
<!-- #$-:Please do not edit lines starting with "#$" -->
<!-- #$VERSION:2.3 -->
<!-- #$AUTHOR:Eric -->
<area shape="rect" coords="2,2,98,97"  onclick="scrollto1()" style="cursor: pointer;"     />
<area shape="rect" coords="102,3,202,95"  onclick="scrollto2()"  style="cursor:     pointer;" />
<area shape="rect" coords="208,3,307,95"  onclick="scrollto3()"  style="cursor: pointer;"/>
<area shape="rect" coords="315,5,409,98"  onclick="scrollto4()"  style="cursor: pointer;"/>
<area shape="rect" coords="413,6,502,97"  onclick="scrollto5()"  style="cursor: pointer;"/>
<area shape="rect" coords="507,4,597,97"  onclick="scrollto6()"  style="cursor: pointer;"/>
</map>

除了 Internet Explorer 10 之外的所有浏览器中都可以单击图像映射。我想知道是否有某种方法可以让 Internet Explorer 中的东西正常工作。

4

1 回答 1

1

我已经更新了你的代码,它现在可以工作了:)

您没有该区域自动关闭,并且您丢失了href="#"并且根本不需要样式:)

检查小提琴以防你想检查

Link : http://jsfiddle.net/MarmeeK/bD4s7/

<img src="http://images5.fanpop.com/image/photos/30600000/Template-800-x-100-pippy-and-jezzis-world-of-purdy-mindedness-30664157-800-100.jpg" width="600" height="100" border="0" usemap="#maps" alt="" />

<map name="maps">

<area shape="rect" coords="2,2,98,97"  onclick="scrollto1()" style="cursor: pointer;"     >
<area shape="rect" coords="102,3,202,95" href="#" >
<area shape="rect" coords="208,3,307,95" href="#" >
<area shape="rect" coords="315,5,409,98" href="#" >
<area shape="rect" coords="413,6,502,97" href="#" >
<area shape="rect" coords="507,4,597,97" href="#" onclick="javascript:alert('hi');" >
</map>
于 2013-03-27T05:48:55.160 回答