zoukankan      html  css  js  c++  java
  • JQuery隔行变色

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title></title>
        <style type="text/css">
            .one {
                color:green;
                /*background-color:black;*/
            }
            .two {
                color:red;
                /*background-color:red;*/
            }
        </style>
        <script src="Js/jquery.js"></script>
        <script type="text/javascript">
            $(function () {
                $(".alone").children("div:first").css("background-color", "#fcfcfc");
                $(".alone").children("div:even").addClass("one");
                $(".alone").children("div:odd").addClass("two");
            });
    
        </script>
    </head>
    <body>
        <div class="alone">
        <div>0000000</div>
        <div>1111111</div>
        <div>2222222</div>
        <div>3333333</div>
        <div>4444444</div>
        <div>5555555</div>
        <div>-------</div>
        <div>6666666</div>
        </div>
    </body>
    </html>
    

    排除第一行变色,剩下的都变色

  • 相关阅读:
    Oracle-DQL 7- 集合操作
    Oracle-DQL 6- 子查询
    Oracle-DQL 5- 分组函数(多行函数)
    Oracle-DQL 4- 多表查询
    Oracle-DQL 3- 单行函数
    构建gulp项目
    重开Vue2.0
    ES6
    emmet简单记录
    webpack 3.X研究
  • 原文地址:https://www.cnblogs.com/wykLog/p/4183178.html
Copyright © 2011-2022 走看看