您好,登錄后才能下訂單哦!
<table summary="when and where you can see the band"> <thead> <tr> <th>Date</th> <th>City</th> <th>Venue</th> </tr> </thead> <tbody> <tr> <td>June 9th</td> <td>Portland, <abbr title="Oregon">OR</abbr></td> <td>Crystal Ballroom</td> </tr> <tr> <td>June 10th</td> <td>Seattle, <abbr title="Washington">WA</abbr></td> <td>Crocodile Cafe</td> </tr> <tr> <td>June 12th</td> <td>Sacramento, <abbr title="California">CA</abbr></td> <td>Torch Club</td> </tr> <tr> <td>June 17th</td> <td>Austin, <abbr title="Texas">TX</abbr></td> <td>Speakeasy</td> </tr> </tbody> </table>
function stipeTables(){ if(!document.getElementsByTagName) return false; var tables = document.getElementsByTagName("table"); var odd,rows; for(var i = 0; i < tables.length; i++){ odd = false; rows = tables[i].getElementsByTagName("tr"); for(var j = 0; j < rows.length; j++){ if(odd == true){ addClass(rows[j],"odd");//rows[j].style.backgroundColor = "#ffc"; 就兼容了 odd = false; }else{ odd = true;} } } } function highlightRows(){ if(!document.getElementsByTagName) return false; var rows = document.getElementsByTagName("tr"); for(var i = 0; i < rows.length; i++){ rows[i].oldClassName = rows[i].className;//把原來的cassName屬性保存到自定義屬性當中 rows[i].onmouseover = function(){ addClass(this,"highlight") ; //this.style.fontWeight = "bold"; } rows[i].onmouseout = function(){ this.className = this.oldClassName; //this.style.fontWeight = "normal"; } } } addLoadEvent(stipeTables); addLoadEvent(highlightRows);
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。