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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

求教各位大神 寫(xiě)了一個(gè)類似日歷的東西

求教各位大神 寫(xiě)了一個(gè)類似日歷的東西

<!DOCTYPE?html> <html> <head> <meta?charset="UTF-8"> <title>日歷</title> <style?type="text/css"> #table1?{ ????border:1px?solid?black; ????width:250px; ????height:250px; } #table1?td{ ????border:1px?solid?black; ????text-align:?center; ????padding:10px; ????width:80px; ????height:80px; } #div1?{ ????background:#ccc; ????width:200px; ????height:420px; ????float:left; } </style> <script?type="text/javascript"> ????window.onload=function?(){ ????????var?oTd=document.getElementsByTagName('td'); ????????var?oDiv=document.getElementById('div1'); ????????var?arr=[ ????????????"111", ????????????"222", ????????????"333", ????????????"444", ????????????"請(qǐng)問(wèn)weq", ????????????"cewdw", ????????????"wswsws", ????????????"zxczxc", ????????????"wswsws", ????????????"qaqaqa", ????????????"dedede", ????????????"xsce", ????????] ????????for?(var?i=0;i<oTd.length;i++){ ????????????oTd[i].index=i; ????????????oTd[i].onmouseover=function?(){ ????????????this.style.backgroundColor="black"; ????????????this.style.color="white"; ????????} ????????????oTd[i].onmouseout=function??(){ ????????????this.style.background=""; ????????????this.style.color=""; ????????} ????????????oDiv.innerHTML=arr[this.index]; ????} ????} </script> </head> <body> <table?id="table1"?> <tr> <td>a</td> <td>b</td> <td>c</td> </tr> <tr> <td>d</td> <td>e</td> <td>f</td> </tr> <tr> <td>g</td> <td>h</td> <td>i</td> </tr> <tr> <td>j</td> <td>k</td> <td>l</td> </tr> <div?id="div1"></div> </table> </body> </html>但是為啥鼠標(biāo)移入之后左邊會(huì)顯示undefined? 求救求救啊困惑好久啦
查看完整描述

4 回答

已采納
?
joffyzou

TA貢獻(xiàn)45條經(jīng)驗(yàn) 獲得超17個(gè)贊

你想寫(xiě)什么效果?是不是鼠標(biāo)放上去,左邊的div里面顯示你鼠標(biāo)所在位置的內(nèi)容?如果是,把

oDiv.innerHTML=arr[this.index]; 移入到 onmouseover? 事件里面去。

查看完整回答
1 反對(duì) 回復(fù) 2017-11-20
?
慕粉3799017

TA貢獻(xiàn)2條經(jīng)驗(yàn) 獲得超1個(gè)贊

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

? ? ? ? ? ? oTd[i].index=i;

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

? ? ? ? ? ? this.style.backgroundColor="black";

? ? ? ? ? ? this.style.color="white";

? ? ? ? ? ? oDiv.innerHTML=arr[this.index];

? ? ? ? }

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

? ? ? ? ? ? this.style.background="";

? ? ? ? ? ? this.style.color="";

? ? ? ? ? ? oDiv.innerHTML="";

? ? ? ? }

? ? }

你看一下這是不是你想要的效果

查看完整回答
1 反對(duì) 回復(fù) 2017-11-21
?
慕沐9665835

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

arr[this.index]里的this指向的是window對(duì)象,window對(duì)象上面沒(méi)有index屬性,所以就顯示為undefined了,解決辦法參考一樓

查看完整回答
1 反對(duì) 回復(fù) 2017-11-20
?
超級(jí)巨浪大切

TA貢獻(xiàn)2條經(jīng)驗(yàn) 獲得超0個(gè)贊

謝謝大家的幫助?。?! 已經(jīng)順利解決了! !!!

查看完整回答
反對(duì) 回復(fù) 2017-11-21
  • 4 回答
  • 0 關(guān)注
  • 2611 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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