表格隔行变色js代码,创建属性-创新互联
Date | City | Venue |
---|---|---|
June 9th | Portland, OR | Crystal Ballroom |
June 10th | Seattle, WA | Crocodile Cafe |
June 12th | Sacramento, CA | Torch Club |
June 17th | Austin, TX | Speakeasy |
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);
创新互联www.cdcxhl.cn,专业提供香港、美国云服务器,动态BGP最优骨干路由自动选择,持续稳定高效的网络助力业务部署。公司持有工信部办法的idc、isp许可证, 机房独有T级流量清洗系统配攻击溯源,准确进行流量调度,确保服务器高可用性。佳节活动现已开启,新人活动云服务器买多久送多久。
成都创新互联主要从事做网站、成都网站建设、网页设计、企业做网站、公司建网站等业务。立足成都服务泰和,10年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:13518219792当前标题:表格隔行变色js代码,创建属性-创新互联
地址分享:http://azwzsj.com/article/pogjs.html