亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

rect()的參數一回兒四個,一會兒三個?為什么?搞不懂請高手幫忙解析?。?/h1>

<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多態的體現

查看完整回答
反對 回復 2022-07-18
  • 1 回答
  • 0 關注
  • 171 瀏覽

添加回答

了解更多

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號