主题:  帮忙看段JS脚本代码

jesron

职务:普通成员
等级:2
金币:1.0
发贴:393
#12005/9/16 12:00:29
深灰色背景从上部,底部往中间消失,要改成从左,右往中间消失,帮下忙。急用。

代码如下:

<HTML><HEAD><TITLE>test!</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<BODY leftMargin=0 topMargin=0>
<STYLE>.intro {
    BORDER-RIGHT: #333333 0px solid; BORDER-TOP: #333333 0px solid; LEFT: 0px; BORDER-LEFT: #333333 0px solid; BORDER-BOTTOM: #333333 0px solid; POSITION: absolute; TOP: 0px; BACKGROUND-COLOR: #333333; layer-background-color: yellow
}
</STYLE>
<DIV class=intro id=i1>1111111111111111111111111111111111111</DIV>
<DIV class=intro id=i2>2222222222222222222222222222222222222</DIV>
<SCRIPT language=javascript1.2>

var speed=10
var temp=new Array()
var temp2=new Array()
if (document.layers){
for (i=1;i<=2;i++){
temp[i]=eval("document.i"+i+".clip")
temp2[i]=eval("document.i"+i)
temp[i].width=window.innerWidth
temp[i].height=window.innerHeight/2
temp2[i].top=(i-1)*temp[i].height
}
}
else if (document.all){
var clipbottom=document.body.offsetWidth/2,cliptop=0
for (i=1;i<=2;i++){
temp[i]=eval("document.all.i"+i+".style")
temp[i].width=document.body.clientWidth
temp[i].height=document.body.offsetHeight/2
temp[i].top=(i-1)*parseInt(temp[i].height)
}
}

function openit(){
window.scrollTo(0,0)
if (document.layers){
temp[1].bottom-=speed
temp[2].top+=speed
if (temp[1].bottom<=0)
clearInterval(stopit)
}
else if (document.all){
clipbottom-=speed
temp[1].clip="rect(0 auto+"+clipbottom+" 0)"
cliptop+=speed
temp[2].clip="rect("+cliptop+" auto auto)"
if (clipbottom<=0)
clearInterval(stopit)
}
}
function gogo(){
stopit=setInterval("openit()",100)
}
gogo()

</SCRIPT>



相关文件(rar):点这儿打开

编辑历史:[此帖最近一次被 jesron 编辑过(编辑时间:2005-09-16 13:49:10)]