<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中运行。
答案 0 :(得分: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>