最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

為啥1行2不行呢

1:

? ? ?/* window.onload = function(){

? ? ? ? var hang=document.getElementsByTagName('tr');

? ? ? ? for(var i=0;i<hang.length;i++){

? ? ? ? ? ?bdc(hang[i]);

? ? ? ? ? ? }

? ? ? ? }

? ? ?function bdc(can){

? ? ? ? ?can.onmouseover=function(){

? ? ? ? ? ? ?can.style.backgroundColor="#f2f2f2";

? ? ? ? ?}

? ? ? ? ?can.onmouseout=function(){

? ? ? ? ? ? ?can.style.backgroundColor="#fff";

? ? ? ? ?}

? ? ?}*/

2: ? ??

? ? window.onload = function(){

? ? ? ? var hang=document.getElementsByTagName('tr');

? ? ? ? for(var i=0;i<hang.length;i++){

? ? ? ? ? ? hang[i].onmouseover=function(){

? ? ? ? ? ? ? ? hang[i].style.backgroundColor="#f2f2f2";

? ? ? ? ? ? }

? ? ? ? ? ? hang[i].onmouseout=function(){

? ? ? ? ? ? ? ? hang[i].style.backgroundColor="#fff";

? ? ? ? ? ? }

? ? ? ? }

? ? }


正在回答

2 回答

2改成

?for(var i=0;i<hang.length;i++){

? ? ? ? ? ? hang[i].onmouseover=function(){

? ? ? ? ? ? ? ? this.style.backgroundColor="#f2f2f2";

? ? ? ? ? ? }

? ? ? ? ? ? hang[i].onmouseout=function(){

? ? ? ? ? ? ? ? this.style.backgroundColor="#fff";

? ? ? ? ? ? }

}

就好了呢~

因?yàn)樵谀闱短椎暮瘮?shù)里面并不知道hang[i]是誰(shuí)啊~

作用域的問(wèn)題

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

山岳之王 提問(wèn)者

非常感謝!受教了
2016-02-29 回復(fù) 有任何疑惑可以回復(fù)我~
#2

白瑞爺 回復(fù) 山岳之王 提問(wèn)者

客氣了~大家共同交流
2016-02-29 回復(fù) 有任何疑惑可以回復(fù)我~

如樓上所言改成this試試。1的函數(shù)里帶參數(shù)

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
JavaScript進(jìn)階篇
  • 參與學(xué)習(xí)       469024    人
  • 解答問(wèn)題       22582    個(gè)

本課程從如何插入JS代碼開(kāi)始,帶您進(jìn)入網(wǎng)頁(yè)動(dòng)態(tài)交互世界

進(jìn)入課程
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

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

公眾號(hào)

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