今天下午完成了一个比较好看的倒影效果,图片的轮动并且有倒影效果。
原理虽然简单,可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
关注
打赏