鼠标移上与离开
var pic2 = document.getElementById("pic2");
//鼠标移动到图片上
pic.onmouseover = function(){
document.getElementById("p1").style.display="block";//show的display属性设置为block(显示)
}
//鼠标离开图片
pic.onmouseout = function(){
document.getElementById("p1").style.display="none";//show的display属性设置为none(隐藏)
}
显示的div
<div id="p1" style="position:absolute;z-index:9999999;top:1300px;left:63% ;display:none">
<img src="F510112919325.JPG" width="200" height="200" />
</div>
触发的div
<img id ="pic2" src="510/1-1F510112919325.JPG" width="60" height="36" style="margin:0px 0px 0px 12px;" />
<p style="margin:0px 0px 0px 0px"></p>
</div>