一个跟随鼠标的图片放大效果,与FF兼容

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

一个跟随鼠标的图片放大效果,与FF兼容

  2020-05-12 我要评论

<div align=center style="overfow: hidden; width: 100px; height: 100px"><img src="https://img.qb5200.com/download-x/20200511/26095.jpg" width="100" height="100" border="0" onmouseover="show(this)" onmouseout="hide(this)">
</div>
<div align=center style="overfow: hidden; width: 100px; height: 100px">
<img src="https://img.qb5200.com/download-x/20200511/26096.jpg" width="100" height="100" border="0" onmouseover="show(this)" onmouseout="hide(this)">
</div>
<div align=center style="overfow: hidden; width: 100px; height: 100px">
<img src="https://img.qb5200.com/download-x/20200511/26097.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需刷新才能执行]

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们