<head><style><!--.intro{position:absolute;left:0;top:0;layer-background-color:#33cc00;background-color:#33cc00;border:0.1px solid black}--></style></head><body><div id="i1" class="intro"></div><div id="i2" class="intro"></div><SCRIPT Language="JavaScript">var speed=20var temp=new Array()var temp2=new Array()if (document.layers){for (i=1;i<=2;i++){temp=eval("document.i"+i+".clip")temp2=eval("document.i"+i)temp.width=window.innerWidthtemp.height=window.innerHeight/2temp2.top=(i-1)*temp.height}}else if (document.all){var clipbottom=document.body.offsetHeight/2,cliptop=0for (i=1;i<=2;i++){temp=eval("document.all.i"+i+".style")temp.width=document.body.clientWidthtemp.height=document.body.offsetHeight/2temp.top=(i-1)*parseInt(temp.height)}}function openit(){window.scrollTo(0,0)if (document.layers){temp[1].bottom-=speedtemp[2].top+=speedif (temp[1].bottom<=0)clearInterval(stopit)}else if (document.all){clipbottom-=speedcliptop+=speedtemp[1].clip="rect(0 auto "+clipbottom+" 0)"temp[2].clip="rect("+cliptop+" auto auto )"if (clipbottom<=0)clearInterval(stopit)}}function gogo(){stopit=setInterval("openit()",1000)}gogo()</SCRIPT></body>這段代碼是用javascript實現層從上下載入的特效,但是本人對代碼中的rect(0 auto "+clipbottom+" 0)和rect("+cliptop+" auto auto )這兩句話不能理解。
rect()的參數一回兒四個,一會兒三個?為什么?搞不懂請高手幫忙解析?。?/h1>
慕田峪9158850
2022-07-14 17:13:27
慕田峪9158850
2022-07-14 17:13:27