|
热门文章 |
|
|
|
相关文章 |
|
没有相关文章 |
|
|
鼠标滑过图片出现大图片提示层效果js代码 |
来源:百学资源站 更新时间:2010/7/18 0:05:08 阅读次数: 我要投稿 |
|
<style> #demo{overflow:hidden;width:120px;text-align:center;padding:10px;} #demo img{border:none;width:100px;height:100px;border:5px solid #f4f4f4} #enlarge_images{position:absolute;display:none;z-index:2;border:5px solid #f4f4f4} </style> <div id="demo" style="overflow:hidden;width:120px;text-align:center;padding:10px"> <img src="http://www.cwydesign.com/effects/UploadFiles_7074/201008/2010081200132355.jpg"> </div> <div id="enlarge_images"></div> <script> var demo = document.getElementById("demo"); var gg = demo.getElementsByTagName("img"); var ei = document.getElementById("enlarge_images"); for(i=0; i<gg.length; i++){ var ts = gg[i]; ts.onmousemove = function(event){ event = event || window.event; ei.style.display = "block"; ei.innerHTML = '<img src="' + this.src + '" />'; ei.style.top = document.body.scrollTop + event.clientY + 10 + "px"; ei.style.left = document.body.scrollLeft + event.clientX + 10 + "px"; } ts.onmouseout = function(){ ei.innerHTML = ""; ei.style.display = "none"; } ts.onclick = function(){ window.open( this.src ); } } </script> |
特效说明: |
鼠标滑过图片出现大图片提示层效果js代码 |
|
上一篇文章: 图片渐影轮播效果下一篇文章: 鼠标滚轮缩放图象(兼容ie、ff、opera) |
|
|