您的位置:首页 > Web前端 > JQuery

jQuery 应用案例1——table隔行变色

2016-10-22 17:33 204 查看
一、参考文档地址
http://hemin.cn/jq/index.html
二、使用jquery实现table隔行变色



$(function{

    $('#table tr:even').css('backgroundColor','red');

    $('#table tr:odd').css('backgroundColor','blue');

})

②一行代码实现效果

$(function{

   $('#table tr').filter(':even').css('backgroundColor','red').end().filter(':odd').css('backgroundColor','blue');

})
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: