最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jQuery實(shí)現(xiàn)表格顏色交替顯示的方法

 更新時(shí)間:2015年03月09日 16:09:38   作者:hcqenjoy  
這篇文章主要介紹了jQuery實(shí)現(xiàn)表格顏色交替顯示的方法,涉及jQuery操作表格樣式的技巧,非常具有實(shí)用價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了jQuery實(shí)現(xiàn)表格顏色交替顯示的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

復(fù)制代碼 代碼如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jQuery實(shí)現(xiàn)表格顏色的交替顯示</title>
<script type="text/javascript" src="js/jquery1.3.2.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
  jQuery(".truecolor tr:odd").addClass("color1");
  jQuery(".truecolor tr:even").addClass("color2");
  jQuery(".truecolor tr").hover(function(){
    jQuery(this).addClass("color3")
  },function(){
    jQuery(this).removeClass("color3")
  });
});
</script>
<style type="text/css">
.truecolor {border:1px solid #333;text-align:center;}
.truecolor th {background-color:#333; color:#FFF;}
.color1 {background-color:#DDD; color:#333;}
.color2 {background-color:#EEE; color:#333;}
.color3 {background-color:#666; color:#FFF;}
</style>
</head>
<body>
<table width="450" class="truecolor">
  <thead>
    <tr>
      <th>博客</th>
      <th>作者</th>
      <th>網(wǎng)址</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>風(fēng)格之舞</td>
      <td>火德</td>
      <td>隔行換色</td>
    </tr>
    <tr>
      <td>趙雷的博客</td>
      <td>趙雷</td>
      <td>新浪微博</td>
    </tr>
    <tr>
      <td>寂寞廣場(chǎng)</td>
      <td>魏春亮</td>
      <td>同學(xué)錄</td>
    </tr>
    <tr>
      <td>淘寶UED</td>
      <td>淘寶</td>
      <td>經(jīng)常購(gòu)物</td>
    </tr>
  </tbody>
</table>
</body>
</html>

希望本文所述對(duì)大家的jQuery程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

剑川县| 新兴县| 邯郸县| 富宁县| 临邑县| 确山县| 西充县| 宜兴市| 突泉县| 策勒县| 望奎县| 明水县| 和静县| 苍溪县| 松溪县| 灵宝市| 河津市| 台山市| 文成县| 黔西县| 玉山县| 镇沅| 温州市| 广元市| 唐山市| 五大连池市| 顺平县| 维西| 新密市| 萨嘎县| 青田县| 吉林市| 惠来县| 枣庄市| 镶黄旗| 连州市| 沧源| 久治县| 杭锦后旗| 贵定县| 怀柔区|