展开全部
层的属性 有一个 visibility,值为hidden 就是隐藏,空字符就默认显示啦
鼠标事件 进入图片 用 onmouseover ,移出图片 onmouseout
下面例子:
<div id="ddd" style="position:absolute;visibility:hidden;background:#aa0000;top:100px;left:100px;width:200px;height:300px;">就是这个层啦</div>
<img src="http://www.baidu.com/img/baidu_logo.gif" onmouseover="dd()" onmouseout="cc()" />
<script>
function dd(){
document.getElementById("ddd").style.visibility="";
}
function cc(){
document.getElementById("ddd").style.visibility="hidden";
}
</script>
鼠标事件 进入图片 用 onmouseover ,移出图片 onmouseout
下面例子:
<div id="ddd" style="position:absolute;visibility:hidden;background:#aa0000;top:100px;left:100px;width:200px;height:300px;">就是这个层啦</div>
<img src="http://www.baidu.com/img/baidu_logo.gif" onmouseover="dd()" onmouseout="cc()" />
<script>
function dd(){
document.getElementById("ddd").style.visibility="";
}
function cc(){
document.getElementById("ddd").style.visibility="hidden";
}
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询