JavaScript 映像地圖

來源:互聯網
上載者:User
JavaScript 映像地圖: 映像地圖指的是帶有可點擊地區的映像。簡單的 HTML 影像地圖

<html>

<body>

<img src="../i/eg_planets.jpg"  border="0" usemap="#planetmap" alt="Planets" />

<map name="planetmap" id="planetmap">

<area shape="circle" coords="180,139,14"
href ="../example/html/venus.html"  target ="_blank" alt="Venus" />

<area shape="circle" coords="129,161,10"
href ="../example/html/mercur.html"  target ="_blank" alt="Mercury" />

<area shape="rect" coords="0,0,110,260"
href ="../example/html/sun.html"  target ="_blank" alt="Sun" />

</map>

</body>
</html>
添加了 JavaScript 的影像地圖

 

<html>
<head>
<script type="text/javascript">
function writeText(txt)
{
document.getElementById("desc").innerHTML=txt
}
</script>
</head>

<body>
<img src="../i/eg_planets.jpg"  border="0" usemap="#planetmap" alt="Planets" />

<map name="planetmap" id="planetmap">

<area shape="circle" coords="180,139,14"
onMouseOver="writeText('直到 20 世紀 60 年代,金星一直被認為是地球的孿生姐妹,因為金星是離我們最近的行星,同時還由於兩者擁有很多共同的特徵。')"
href ="../example/html/venus.html"  target ="_blank" alt="Venus" />

<area shape="circle" coords="129,161,10"
onMouseOver="writeText('從地球上是很難研究水星的,這樣由於它和太陽的距離總是很近。')"
href ="../example/html/mercur.html"  target ="_blank" alt="Mercury" />

<area shape="rect" coords="0,0,110,260"
onMouseOver="writeText('太陽和類似木星這樣的氣態行星是到目前為止太陽系中最大的物體。')"
href ="../example/html/sun.html"  target ="_blank" alt="Sun" />

</map>

<p id="desc"></p>

</body>
</html>


 

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.