1 <script>
2 var demo= document.getElementById("demo");
3 var gg= demo.getElementsByTagName("img");
4 var ei= document.getElementById("enlarge_images");
5 for(i=0; i<gg.length; i++){
6 var ts= gg[i];
7 ts.onmousemove=function(event){
8 event= event|| window.event;
9 ei.style.display="block";
10 ei.innerHTML='<img src="' + this.src + '" />';
11 ei.style.top = document.body.scrollTop+ event.clientY + 20+"px";
12 ei.style.left= document.body.scrollLeft+ event.clientX + 20+"px";
13 }
14 ts.onmouseout=function(){
15 ei.innerHTML="";
16 ei.style.display="none";
17 }
18 ts.onclick=function(){
19 window.open(this.src );
20 }
21 }
22 </script>
23 原文出处http://www.52rs.net/
鼠标移动显示大图
最新推荐文章于 2022-07-13 10:37:21 发布