zoukankan      html  css  js  c++  java
  • table行颜色设置

    function renderingTable(obj){
        $(obj).each(function(){
            //设置奇数行颜色
            $(this).find("tr:even").css("background-color", '#e9f3fa');

       //设置偶数行颜色

       $(this).find("tr:odd").css("background-color", "#f0f0f0");

       //鼠标移动到首行对首中的<td>元素变色   hover用法关键
            $(this).find("tr:eq(0) td").hover(
                    function(){$(this).attr("bColor", $(this).css("background-color")).css("background-color", "#cceaff").css("cursor", "pointer");},
                    function(){$(this).css("background-color", $(this).attr("bColor"));}
            );

       //鼠标移动到其他行变色   hover用法关键
            $(this).find("tr:not(:first)").hover(
                    function(){$(this).attr("bColor", $(this).css("background-color")).css("background-color", "#cceaff").css("cursor", "pointer");},
                    function(){$(this).css("background-color", $(this).attr("bColor"));}
            );
        });
    }

  • 相关阅读:
    OD: Kernel Vulnerabilities
    newInstance()和new的区别
    原型模式
    工厂模式
    代理模式
    策略模式
    简单工厂模式
    C#操作符的重载
    旅行之舌尖上的中国
    模式和原则[转载]
  • 原文地址:https://www.cnblogs.com/Jiphen/p/4602439.html
Copyright © 2011-2022 走看看