jq简单隔行变色demo示例(整理)

简介: jq简单隔行变色demo示例(整理)
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>隔行变色</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .interlaced-discoloration div span{
            width: 24.5%;
            height: 26px;
            line-height: 26px;
            text-align: center;
            display: inline-block;
        }
    </style>
</head>
<body>
    <div class="interlaced-discoloration">
        <div>
            <span>某某</span>
            <span>372901199304226117</span>
            <span>15054054533</span>
            <span>山东菏泽市牡丹区</span>
        </div>
        <div>
            <span>某某</span>
            <span>372901199304226117</span>
            <span>15054054533</span>
            <span>山东菏泽市牡丹区</span>
        </div>
        <div>
            <span>某某</span>
            <span>372901199304226117</span>
            <span>15054054533</span>
            <span>山东菏泽市牡丹区</span>
        </div>
        <div>
            <span>某某</span>
            <span>372901199304226117</span>
            <span>15054054533</span>
            <span>山东菏泽市牡丹区</span>
        </div>
        <div>
            <span>某某</span>
            <span>372901199304226117</span>
            <span>15054054533</span>
            <span>山东菏泽市牡丹区</span>
        </div>
        <div>
            <span>某某</span>
            <span>372901199304226117</span>
            <span>15054054533</span>
            <span>山东菏泽市牡丹区</span>
        </div>
        <div>
            <span>某某</span>
            <span>372901199304226117</span>
            <span>15054054533</span>
            <span>山东菏泽市牡丹区</span>
        </div>
        <div>
            <span>某某</span>
            <span>372901199304226117</span>
            <span>15054054533</span>
            <span>山东菏泽市牡丹区</span>
        </div>
        <div>
            <span>某某</span>
            <span>372901199304226117</span>
            <span>15054054533</span>
            <span>山东菏泽市牡丹区</span>
        </div>
        <div>
            <span>某某</span>
            <span>372901199304226117</span>
            <span>15054054533</span>
            <span>山东菏泽市牡丹区</span>
        </div>
        <div>
            <span>某某</span>
            <span>372901199304226117</span>
            <span>15054054533</span>
            <span>山东菏泽市牡丹区</span>
        </div>
    </div>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
    <script>
        // div中的奇数行偶数行设置不同的颜色
        $(".interlaced-discoloration div:odd").css("backgroundColor","#2eadd6");
        $(".interlaced-discoloration div:even").css("backgroundColor","#fff");
    </script>
</body>
</html>

相关文章
|
JavaScript
js左划出现删除按钮,右滑隐藏demo效果示例(整理)
js左划出现删除按钮,右滑隐藏demo效果示例(整理)
js左划出现删除按钮,右滑隐藏demo效果示例(整理)
|
JavaScript
js多图片上传--可删除demo效果示例(整理)
js多图片上传--可删除demo效果示例(整理)
|
JavaScript
js简单全选及反选demo效果示例(整理)
js简单全选及反选demo效果示例(整理)
|
JavaScript
js锚点demo效果示例(整理)
js锚点demo效果示例(整理)
简单JS--点击谁添加背景色demo效果示例(整理)
简单JS--点击谁添加背景色demo效果示例(整理)
|
JavaScript
jquery多图片上传预览demo效果示例(整理)
jquery多图片上传预览demo效果示例(整理)
|
JavaScript
js点击删除当前demo示例(整理)
js点击删除当前demo示例(整理)
|
JavaScript
JQuery 判断radio是否有选中,获取选中的值demo示例(整理)
JQuery 判断radio是否有选中,获取选中的值demo示例(整理)