//根据分辩率控制层的位置,注意要放在div之后,否则会说找不着对象。
//最好的办法就是放在html最后啦...
//如果一定要放前面,那就用Function吧,在Body的onload事件中加上XXX()即可。
//DIV的ID(名称)一定要对号,字母大小写要一致这里就不多说了。
<!--
if (screen.width == 800) {
Layer1.style.top = 81
Layer1.style.left = 538
Layer2.style.left = 45
Layer2.style.top = 196
}
else if (screen.width == 1280) {
Layer1.style.top = 81
Layer1.style.left = 765
Layer2.style.left = 272
Layer2.style.top = 196
}
else
{
Layer1.style.left = 638
Layer1.style.top=81
Layer2.style.left = 150
Layer2.style.top = 196
}
//-->
</script>
试试看
您好!首先你提到的css的area标签是不支持hover的,只有a标签才支持。li标签在IE浏览器下才支持。你说的效果完全可以用js来实现啊!我为你整理了一下代码,希望对您有帮助:<script>
function ahover(id)
{
alert(document.getElementById(id).className)
}
</script>
<div class="fc-show-box" >
<img src="33.jpg" width="950" height="569" border="0" usemap="#Map" />
<map name="map">
<area class="item1" shape="poly" id="a1" onmouseover="ahover('a1')" coords="30,39,209,39,209,538,30,538" href="#" />
<area class="item2" shape="poly" id="a2" onmouseover="ahover('a2')" coords="215,40,447,39,447,545,215,545" href="#" />
<area class="item3" shape="poly" id="a3" onmouseover="ahover('a3')" coords="453,13,585,13,585,561,453,580" href="#" />
</map>
</div>