第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

關(guān)于函數(shù)的調(diào)用疑問

關(guān)于函數(shù)的調(diào)用疑問

天窗的螞蟻 2016-03-05 22:26:35
<!DOCTYPE?HTML> <html> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"> <title>無標(biāo)題文檔</title> <style?type="text/css"> ????#div1{width:200px;height:30px;background-color:red;} ????#div2{width:150px;?height:20px;background-color:gray;margin-top:10px;display:none;} </style> <script?type="text/javascript"> ????window.onload?=?function?()?{ ????????var?div1?=?document.getElementById("div1"); ????????var?div2?=?document.getElementById("div2"); ????????var?timer?=?null; ????????function?show()?{ ????????????div2.style.display?=?"block"; ????????????clearTimeout(timer); ????????} ????????function?hide()?{ ????????????timer?=?setTimeout(function?()?{?div2.style.display?=?"none";?},?300); ????????} ????????div1.onmouseover?=?show; ????????div1.onmouseout?=?hide; ????????div2.onmouseover?=?show; ????????div2.onmouseout?=?hide; ????} </script> </head> <body> <div?id="div1"></div> <div?id="div2"></div> </body> </html>????????div1.onmouseover?=?show; ????????div1.onmouseout?=?hide; ????????div2.onmouseover?=?show; ????????div2.onmouseout?=?hide;為啥我要是寫成div1.onmouseover?=?show(); ??????????????????????????????????????????????div1.onmouseout?=?hide(); ??????????????????????????????????????????????div2.onmouseover?=?show(); ??????????????????????????????????????????????div2.onmouseout?=?hide();就不行呢?函數(shù)的調(diào)用不得加上后面的括號嗎?求解答
查看完整描述

1 回答

?
慕無忌8876879

TA貢獻(xiàn)8條經(jīng)驗 獲得超3個贊

加上括號,你的方法就執(zhí)行了,但是不會賦值給你的div1.onmouseover了,當(dāng)出發(fā)你的div1.onmouseover的時候就不會調(diào)用show了


查看完整回答
反對 回復(fù) 2016-03-06
  • 1 回答
  • 0 關(guān)注
  • 1409 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號