问题描述:我是想当鼠标滑过图像上的苹果时,在页面上的id=“txt”<P>标签上显示“这是苹果”,可是结果却是当鼠标滑过图像上得苹果后,整幅图像却消失了,“我是苹果”这些字没有显示在id=“txt”的<P>标签上。同样,梨子和葡萄也是一样的问题。html代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script type="text/javascript">
function write(txt)
{
document.getElementById('xie').innerHTML=txt;
}
</script>
<style type="text/css">
.dd{
height:40px;
width:200px;
background-color:yellow;
}
</style>
</head>
<body>
<img src="tu/shuiguo.jpg" usemap="#id" height="400px" width="400px" border="0" />
<map id="id" name="id">
<area coords="13,235,80,320" shape="rect" onmousemove="write('这是橙子')" /><area shape="rect" coords="300,145,375,230" onmousemove="write('这是苹果')" />
<area shape="rect" coords="200,150,260,260" onmousemove="write('这是葡萄')" /></map>
<br />:
<br /><div id="xie" class="dd"></div>
</body>
</html>
希望有人能解决问题!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script type="text/javascript">
function write(txt)
{
document.getElementById('xie').innerHTML=txt;
}
</script>
<style type="text/css">
.dd{
height:40px;
width:200px;
background-color:yellow;
}
</style>
</head>
<body>
<img src="tu/shuiguo.jpg" usemap="#id" height="400px" width="400px" border="0" />
<map id="id" name="id">
<area coords="13,235,80,320" shape="rect" onmousemove="write('这是橙子')" /><area shape="rect" coords="300,145,375,230" onmousemove="write('这是苹果')" />
<area shape="rect" coords="200,150,260,260" onmousemove="write('这是葡萄')" /></map>
<br />:
<br /><div id="xie" class="dd"></div>
</body>
</html>
希望有人能解决问题!
解决方案 »
- iframe里面创建DIV
- php类似于团购的剩余时间
- obj0.childNodes[i]总为空,而obj0.childNodes[i].nodeValue总为null,请教了
- 帮忙看看
- 如何读取用TDC绑定的数据内容?
- 求关于prototype的each方法解释
- 如何记住页面拖曳后位置
- 【已结束】CSDN论坛 第10期专家问答——JavaScript开发答疑
- 用asp能在网页上作图吗??
- 为什么用window.open打开的窗口只能出现一个,即前一个用window.open打开的窗口自动关闭?怎样才能使两个用window.open打开的窗口都显示呢?
- 如何做出携程网 酒店价格提示框那种效果?
- 下拉框js问题
刚才问题描述那说错了,应该是id=“xie”的《div》标签上显示文字