国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

js實現(xiàn)綠白相間豎向網(wǎng)頁百葉窗動畫切換效果

2019-11-20 13:03:38
字體:
供稿:網(wǎng)友

本文實例講述了js實現(xiàn)綠白相間豎向網(wǎng)頁百葉窗動畫切換效果。分享給大家供大家參考。具體分析如下:

前面我們講解了一個網(wǎng)頁百葉窗切換動畫效果,不過是橫向百葉窗,這個是豎向百葉窗,代碼基本一樣:

復(fù)制代碼 代碼如下:
<html>
<head>
<title>百葉窗頁面切換效果</title>
<style>
<!--
.intro{
position:absolute;
left:0;
top:0;
layer-background-color:green;
background-color:green;
border:0.1px solid green
}
-->
</style>
</head>
<body>
<div id="i1" class="intro"></div><div id="i2" class="intro"></div><div id="i3"
class="intro"></div><div id="i4" class="intro"></div><div id="i5" class="intro"></div><div
id="i6" class="intro"></div><div id="i7" class="intro"></div><div id="i8" class="intro"></div>
<script language="JavaScript1.2">
var speed=20
var temp=new Array()
var temp2=new Array()
if (document.layers){
for (i=1;i<=8;i++){
temp[i]=eval("document.i"+i+".clip")
temp2[i]=eval("document.i"+i)
temp[i].width=window.innerWidth/8-0.3
temp[i].height=window.innerHeight
temp2[i].left=(i-1)*temp[i].width
}
}
else if (document.all){
var clipbottom=document.body.offsetHeight,cliptop=0
for (i=1;i<=8;i++){
temp[i]=eval("document.all.i"+i+".style")
temp[i].width=document.body.clientWidth/8
temp[i].height=document.body.offsetHeight
temp[i].left=(i-1)*parseInt(temp[i].width)
}
}
function openit(){
window.scrollTo(0,0)
if (document.layers){
for (i=1;i<=8;i=i+2)
temp[i].bottom-=speed
for (i=2;i<=8;i=i+2)
temp[i].top+=speed
if (temp[2].top>window.innerHeight)
clearInterval(stopit)
}
else if (document.all){
clipbottom-=speed
for (i=1;i<=8;i=i+2){
temp[i].clip="rect(0 auto+"+clipbottom+" 0)"
}
cliptop+=speed
for (i=2;i<=8;i=i+2){
temp[i].clip="rect("+cliptop+" auto auto)"
}
if (clipbottom<=0)
clearInterval(stopit)
}
}
function gogo(){
stopit=setInterval("openit()",100)
}
gogo()
</script>
</body>
</html>

希望本文所述對大家的javascript程序設(shè)計有所幫助。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 宿州市| 紫云| 正定县| 邹平县| 集安市| 浦江县| 绥棱县| 弋阳县| 平罗县| 巴林左旗| 小金县| 沽源县| 谷城县| 信阳市| 京山县| 正定县| 东兰县| 孟州市| 花莲县| 绥宁县| 长武县| 鸡东县| 宁都县| 河源市| 子长县| 井陉县| 都兰县| 鄱阳县| 义马市| 莆田市| 徐水县| 海晏县| 平武县| 都江堰市| 类乌齐县| 梁山县| 东莞市| 开封县| 马关县| 彭州市| 河北省|