鼠标移动到图片显示大图的javascript代码
<script type=”text/javascript”>
function showPic(sUrl,evt){
var x,y;
x = evt.clientX;
y = evt.clientY;
document.getElementById(”Layer1″).style.left = x;
document.getElementById(”Layer1″).style.top = y;
document.getElementById(”Layer1″).innerHTML = “<img src=\”" + sUrl + “\”>”;
document.getElementById(”Layer1″).style.display = “block”;
}
function hiddenPic(){
document.getElementById(”Layer1″).innerHTML = “”;
document.getElementById(”Layer1″).style.display = “none”;
}
</script>
<div id=”Layer1″ style=”DISPLAY: none; Z-INDEX: 1; POSITION: absolute”></div>
<img onmouseover=”showPic(this.src,event);” onmouseout=”hiddenPic();” alt=”" src=”111.jpg” />