阅读背景:

jQuery设置列表的表格背景颜色交替

来源:互联网 
JS方法:
/**
 * 设置列表的表格背景颜色交替
 */
function setTableBgColor(){
    // jQuery获取多个class:$(".blue_table,.<span style="font-family: Arial, Helvetica, sans-serif;">fixed_table</span><span style="font-family: Arial, Helvetica, sans-serif;">")</span>
    $(".<span style="font-family: Arial, Helvetica, sans-serif;">blue_table</span><span style="font-family: Arial, Helvetica, sans-serif;">").each(function () {</span>
        var _this = $(this);
        //设置奇数行(odd)和偶数行(even)颜色
        _this.find("tr:odd").addClass('odd');
        _this.find("tr:even").addClass('even');
 
        //鼠标移动隔行变色用hover
        _this.find("tr").hover(function () {
            $(this).attr("bgColor", $(this).css("background-color")).css("background-color", "#f9f3da").css("cursor", "pointer");
        }, function () {
            $(this).css("background-color", $(this).attr("bgColor"));
        });
 
    });
}/**
 * 设置列表的表格背景颜色交替
 */
function setTa



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: