我想知道这段代码和那些区域的问题在哪里 为什么它在谷歌Chrome中工作 但是当我在IE和Edge上尝试它时,它只是在正确的图像中工作 你可以在任何html在线编辑器中测试代码
<!DOCTYPE html>
<html>
<body>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/Small_Flag_of_the_United_Nations_ZP.svg/488px-Small_Flag_of_the_United_Nations_ZP.svg.png" width="145" height="126" alt="Planets" usemap="#planetmap">
<img src="http://www.hdiphonewallpapers.us/phone-wallpapers/mobilewallpaper/1293W01Z93120-34333.jpg" usemap="myMap">
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" href="javascript:alert('suuun');">
<area shape="circle" coords="90,58,3" href="javascript:alert('suuun');">
<area shape="circle" coords="124,58,8" href="javascript:alert('suuun');">>
</map>
<map name="myMap" >
<area shape="rect" coords="0,0,100,126" href="javascript:alert('suuun');">
<area shape="rect" id="lblTotalQtyVal" href="javascript:alert('suuun');">
<area shape="rect" coords="3,206,152,223" id="lblTotalQty" href="javascript:alert('Hello');">
<area id="cboWarehouse" href="javascript:alert('Hello');" shape="rect" coords="71,21,218,39">
<area id="lblWarehouse" href="javascript:alert('Hello');" shape="rect" coords="5,21,65,40">
<area id="lblCurrentQtyVal" href="javascript:alert('Hello');" shape="rect" coords="3,259,79,277">
<area id="lblCurrentQty" href="javascript:alert('Hello');" shape="rect" coords="3,246,79,259">
<area id="lblNetQtyVal" href="javascript:alert('Hello');" shape="rect" coords="80,259,156,277">
<area id="lblNetQty" href="javascript:alert('Hello');" shape="rect" coords="80,246,156,259">
<area id="btnQuickUnload" href="javascript:alert('Hello');" shape="rect" coords="166,246,236,280">
<area id="btnUnloadVan" href="javascript:alert('Hello');" shape="rect" coords="85,283,155,317">
<area id="btnNextScreen" href="javascript:alert('Hello');" shape="rect" coords="219,21,237,39">
<area id="cboStatus" href="javascript:alert('Hello');" shape="rect" coords="71,40,237,58">
<area id="lblStatus" href="javascript:alert('Hello');" shape="rect" coords="5,40,55,59">
<area id="btnNext" href="javascript:alert('Hello');" shape="rect" coords="166,283,236,317">
<area id="btnClear" href="javascript:alert('Hello');" shape="rect" coords="199,79,237,97">
<area id="btnFind" href="javascript:alert('Hello');" shape="rect" coords="159,79,197,97">
<area id="txtFind" href="javascript:alert('Hello');" shape="rect" coords="3,79,158,97">
<area id="lblCat" href="javascript:alert('Hello');" shape="rect" coords="3,60,178,78">
<area id="btnViewAll" href="javascript:alert('Hello');" shape="rect" coords="219,60,237,78">
<area id="btnFavr" href="javascript:alert('Hello');" shape="rect" coords="199,60,217,78">
<area shape="rect" coords="179,60,197,78" id="btnMore" href="javascript:alert('Hello');" >
<area shape="rect" id="lblSelectedItem" href="javascript:alert('Hello');">
<area shape="rect" coords="3,283,73,317" id="btnBack" href="javascript:alert('Hello');">
<area shape="rect" coords="3,98,237,206" id="grdItem" href="javascript:alert('Hello');">
</map>
</body>
</html>
答案 0 :(得分:0)
usemap="myMap"
之前,IE需要哈希符号
而在chrome中,将名称与哈希符号放在一起并不是问题
或没有它
<img src="http://www.hdiphonewallpapers.us/phone-wallpapers/mobilewallpaper/1293W01Z93120-34333.jpg" usemap="myMap">