JavaScript 图像映射 【每日一段代码71】
<html>
<head>
<title>添加了 JavaScript 的图像映射</title>
<script type="text/javascript">
function writeText(txt)
{
document.getElementById("desc").innerHTML=txt;
}
</script>
</head>
<body>
<img src="xing.jpg" border="0" usemap="#planetmap" />
<map name="planetmap" id="planetmap">
<area shape="circle" coords="180,139,14" onMouseOver="writeText('金星牛逼')" href="#" target="_blank" alt="Venus" />
<area shape="circle" coords="129,161,10" onMouseOver="writeText('水星厉害')" href="#" target="_blank" alt="Mercury" />
<area shape="rect" coords="0,0,110,260" onMouseOver="writeText('太阳我哩个擦')" href="#" target="_blank" alt="Sun" />
</map>
<p id="desc"></p>
</body>
</html>
html5