今天下午完成了一个比较好看的倒影效果,图片的轮动并且有倒影效果。
原理虽然简单,可JavaScript可真是折磨人啊!
下面是代码和演示图:
带倒影的动画效果模拟
body {text-align:center;
topmargin:0;
leftmargin:0;
background:yellow;}
#dawn0919 {position:relative;
text-align:center;
topmargin:0;
leftmargin:0;
background:red;
width:1024;
height:600;
border:0;
overflow:hidden;
z-index:1;}
#dawn0718 {position:absolute;
top:20;
left:0;
width:1024;
height:300;
background:blue;
overflow:hidden;
}
#dawn0401 {position:absolute;
top:320;
left:0;
width:1024;
height:300;
background:green;
overflow:hidden;
}
img {width:100%;
height:100%;
}
.TopSetOther {position:relative;
margin-left:9px;
marginr-ight:9px;
float:left;
width:60px;
height:40px;
top:260px;
}
.TopSetMid {position:relative;
margin-left:9px;
marginr-ight:9px;
float:left;
width:400px;
height:300px;
top:0px;
}
.BottomSetOther{position:relative;
margin-left:9px;
marginr-ight:9px;
float:left;
width:60px;
height:40px;
top:0px;
filter:alpha(opacity=30) flipv();
}
.BottomSetMid {position:relative;
margin-left:9px;
marginr-ight:9px;
float:left;
width:400px;
height:300px;
top:0px;
filter:alpha(opacity=30) flipv();
}
//blog.csdn.net/dawn0718
var ICurrentSpanID;
var IMainSpanID;
function Init(){
ICurrentSpanID=6;
IMainSpanID=5;
}
function SetID(ISPanID){
StopSwith();
ICurrentSpanID=ISPanID;
SwitchID();
}
function SwitchID(){
if (ICurrentSpanID!=IMainSpanID) {
document.all["TopBlock"+ICurrentSpanID].style.width = 400;
document.all["TopBlock"+ICurrentSpanID].style.height = 300;
document.all["TopBlock"+ICurrentSpanID].style.pixelTop = 0;
document.all["BottomBlock"+ICurrentSpanID].style.width = 400;
document.all["BottomBlock"+ICurrentSpanID].style.height = 300;
document.all["BottomBlock"+ICurrentSpanID].style.pixelTop = 0;
if (ICurrentSpanID
关注
打赏
最近更新
- 深拷贝和浅拷贝的区别(重点)
- 【Vue】走进Vue框架世界
- 【云服务器】项目部署—搭建网站—vue电商后台管理系统
- 【React介绍】 一文带你深入React
- 【React】React组件实例的三大属性之state,props,refs(你学废了吗)
- 【脚手架VueCLI】从零开始,创建一个VUE项目
- 【React】深入理解React组件生命周期----图文详解(含代码)
- 【React】DOM的Diffing算法是什么?以及DOM中key的作用----经典面试题
- 【React】1_使用React脚手架创建项目步骤--------详解(含项目结构说明)
- 【React】2_如何使用react脚手架写一个简单的页面?