<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 )這兩句話不能理解。
1 回答

慕運維8079593
TA貢獻1876條經驗 獲得超5個贊
你可以看看rect函數的源碼 或者把它貼出來看看
js對函數參數數目不是很嚴格,如果是4個形參,你只傳入3個實參,它就把第4個參數置為null,這個也是js多態的體現
- 1 回答
- 0 關注
- 171 瀏覽