- 中查找“CSS透视镜效果”更多相关内容
- 中查找“CSS透视镜效果”更多相关内容
- ·上一篇文章:5个优化CSS代码的技巧
- ·下一篇文章:CSS代码中px与pt的区别
CSS透视镜效果
<style>
body{
background:url(http://www.zcool.com.cn/pic/background/23/bg23_005.gif);
overflow:hidden;
}
</style>
<body>
<script>
function id(obj){//取id函数
return document.getElementById(obj);
}
window.onload=function(){
id("mask").setCapture();
}
function mm(obj){
id("mask").setCapture();
obj.style.left=window.event.x-1500;
obj.style.top=window.event.y-1500;
}
</script>
<div id=mask style="position:absolute;width:3000;height:3000px;" onmousemove="mm(this);">
<div style="float:left;width:1490px;height:1490px;background-color:white;filter:alpha(opacity=50);"></div>
<div style="float:left;width:20px;height:1490px;background-color:white;filter:alpha(opacity=50);"></div>
<div style="float:left;width:1490px;height:1490px;background-color:white;filter:alpha(opacity=50);"></div>
<div style="float:left;width:1490px;height:20px;background-color:white;filter:alpha(opacity=50);"></div>
<div style="float:left;width:20px;height:20px;"></div>
<div style="float:left;width:1490px;height:20px;background-color:white;filter:alpha(opacity=50);"></div>
<div style="float:left;width:1490px;height:1490px;background-color:white;filter:alpha(opacity=50);"></div>
<div style="float:left;width:20px;height:1490px;background-color:white;filter:alpha(opacity=50);"></div>
<div style="float:left;width:1490px;height:1490px;background-color:white;filter:alpha(opacity=50);"></div>
</div>
</body>