今天给大家分享的是由图老师小编精心为您推荐的一个跟随鼠标的图片放大效果与FF兼容,喜欢的朋友可以分享一下,也算是给小编一份支持,大家都不容易啊!
【 tulaoshi.com - Web开发 】
div style="text-align:center" style="overfow: hidden; width: 100px; height: 100px"img src="http://img.warting.com/allimg/2015/1222/lizry520ci4-2292.jpg" width="100" height="100" border="0" onmouseover="show(this)" onmouseout="hide(this)"
/div
div style="text-align:center" style="overfow: hidden; width: 100px; height: 100px"
img src="http://img.warting.com/allimg/2015/1222/vn0f42y4r1e-2293.jpg" width="100" height="100" border="0" onmouseover="show(this)" onmouseout="hide(this)"
/div
div style="text-align:center" style="overfow: hidden; width: 100px; height: 100px"
img src="http://img.warting.com/allimg/2015/1222/3boqhgqb0ca-2294.jpg" width="100" height="100" border="0" onmouseover="show(this)" onmouseout="hide(this)"
/div
div id="enlarge_images" style="position: absolute; z-index:2"/div
SCRIPT
function show(_this) {
document.getElementById("enlarge_images").innerHTML = "img src='" + _this.src + "' ";
}
function hide(_this) {
document.getElementById("enlarge_images").innerHTML = "";
}
function move_layer(event){
event = event || window.event;
enlarge_images.style.left=event.clientX+document.body.scrollLeft+10;
enlarge_images.style.top=event.clientY+document.body.scrollTop+10;
}
document.onmousemove =move_layer;
/SCRIPT
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
来源:http://www.tulaoshi.com/n/20160219/1592598.html
看过《一个跟随鼠标的图片放大效果与FF兼容》的人还看了以下文章 更多>>