【发布时间】:2014-07-28 11:33:24
【问题描述】:
我想编写一个代码,当我点击图像的一部分时,我会跳转到一些特定的部分,但以下代码不能正常工作。
<div>
<img id="FMC" src="img/FMC.png" alt="FMC" id="center"
style="position:absolute; top: 50%; left: 28%; top:15%; margin-left: -(X/2)px; margin-top: -(Y/2)px; WIDTH:857px; HEIGHT:500px"
usemap="#FMCmap"/>
<map name="FMCmap" id="FMCmap" >
<area shape="rect" coords="0,0,400,200" href="#abcd" />
<script type="text/javascript">
$('area').on('click',function(e) {
e.preventDefault();
$(this.href).show().siblings().hide();
});
</script>
</map>
</div>
【问题讨论】:
标签: javascript jquery html area