一个跟随鼠标的图片放大效果,与FF兼容
<div align=center style="overfow: hidden; width: 100px; height: 100px"><img src="/upload/2007426163751315.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="/upload/200742616381460.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="/upload/200742616383849.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需再刷新一下页面才能执行]
相关文章
用javascript实现的图片马赛克后显示并切换加文字功能
用javascript实现的图片马赛克后显示并切换加文字功能...2007-04-04javascript实现网站顶部出现几秒后图片缓慢消失的效果
快过年了,很多网站首页都放上了新春的祝福,有些是直接换成皮肤了,而有些则是用一张很大的图片放在网站顶部,在倒数几秒后,缓慢升上去直到最后消失。2011-01-01
最新评论