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"));}
            );
        });
    }

  • 相关阅读:
    Spring源码剖析4:懒加载的单例Bean获取过程分析
    css3动画 9步
    删除文件
    监听变量的方法
    jPaginate应用
    bg-render+bg-class+filter
    css兼容处理
    系统前端关键点
    token 入门教程
    svg笔记----------path篇
  • 原文地址:https://www.cnblogs.com/Jiphen/p/4602439.html
Copyright © 2011-2022 走看看