苦瓜打怪兽 2022-06-23 21:55 采纳率: 50%
浏览 31
已结题

JavaScript的onmouseover事件实例:移入图片某处显示文字。

今天碰到了一个对我来说比较难的JavaScript练习题,做了一天都没有做出来,oh No!大家帮帮忙吧,谢谢你。
问题1:coords里面的四个数代表什么,我以为是调焦点位置的,还按照css里翻译成(left,top,width,height)来调位置。
问题2:href ="jdgjj.htm" target ="_blank" alt="Sun",这句代码是什么意思,里面的内容可以随意改吗?
感谢各位!

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
<script>
function writeText(txt){
    document.getElementById("desc").innerHTML=txt;
}
</script>

</head>

<body>
<img src="img/2.webp" width ="400" height ="550" usemap="#map" />
<map name="map">
<area shape ="rect" coords ="0,0,400,70"
onmouseover="writeText('间谍过家家全家福!')"
href ="jdgjj.htm" target ="_blank" alt="Sun" />

<area shape ="rect" coords ="0,60,140,40"
onmouseover="writeText('间谍过家家全家福!')"
href ="jdgjj1.htm" target ="_blank" alt="Sun" />

<area shape ="rect" coords ="0,60,130,50"
onmouseover="writeText('间谍过家家全家福!')"
href ="jdgjj2.htm" target ="_blank" alt="Sun" />

<area shape ="rect" coords ="49,100,72,260"
onmouseover="writeText('这个女人我也不认识')"
href ="gril.htm" target ="_blank" alt="Mercury" />

<area shape ="rect" coords ="140,70,125,220"
onmouseover="writeText('这位是黄昏先生哦!')"
href ="hh.htm" target ="_blank" alt="Venus" />

<area shape ="rect" coords ="265,110,85,205"
onmouseover="writeText('这位是漂亮的约尔小姐!')"
href ="yueer.htm" target ="_blank" alt="Venus" />

<area shape ="rect" coords ="120,290,110,250"
onmouseover="writeText('这个是小白!!!')"
href ="white.htm" target ="_blank" alt="Venus" />

<area shape ="rect" coords ="30,370,90,170"
onmouseover="writeText('这个是小白!!!')"
href ="white1.htm" target ="_blank" alt="Venus" />

<area shape ="rect" coords ="230,320,90,220"
onmouseover="writeText('这个是最最最可爱的安妮亚!!!')"
href ="anniya.htm" target ="_blank" alt="Venus" />

<area shape ="rect" coords ="340,430,60,80"
onmouseover="writeText('呀!我是情报员!')"
href ="qby.htm" target ="_blank" alt="Venus" />

</map> 
<p id="desc">点击全家福来认识安妮亚吧!</p>

</body>
</html>

  • 写回答

1条回答 默认 最新

报告相同问题?

问题事件

  • 系统已结题 7月2日
  • 已采纳回答 6月24日
  • 创建了问题 6月23日

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效