首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

a标签点击改变色彩,同时table里面内容颜色改变

2012-07-03 
a标签点击改变颜色,同时table里面内容颜色改变script typetext/javascriptfunction changeColor(tabl

a标签点击改变颜色,同时table里面内容颜色改变

<script type="text/javascript">  function changeColor(table, color, background, wordcolor){var t=document.getElementById(table).getElementsByTagName("td");for(var i=0;i<t.length;i++){t[i].style.backgroundColor=color;t[i].onmouseover=function(){if(this.x!="1") {this.style.backgroundColor=background;this.style.color= wordcolor;}}t[i].onmouseout=function(){if(this.x!="1") {this.style.backgroundColor=color;this.style.color= "#000000";}}}  }  </script>  <style type="text/css">  body{width:100%; font:13px "宋体", Arial, Helvetica, sans-serif; color:#333;}  .areaList{border:1px #000 solid;border-left:none;border-bottom:none;}.areaList td{border-left:1px #000 solid;border-bottom:1px #000 solid;height:35px;text-align:center;}a {text-decoration: none;color: #000000;}a:HOVER {color: #A91709;}  </style>

?

<div style="background-color:#FFFFFF;"><h2><center>省级骨干横向</center></h2>    <div>      <table id="areaList" border="0" cellspacing="0" cellpadding="0" width="800px" align="center"><tbody><td>地址</td><td>名称</td></tbody><tr><td>172.168.0.1</td><td><a href="performanceMonitor.do?action=more" target="_blank" target="_blank">路由器</a></td></tr></table>    </div></div><script type="text/javascript">   changeColor("areaList", "#FFF", "#9CCFFF", "#A91709");  </script>
?

?

热点排行