zoukankan      html  css  js  c++  java
  • zepto

    <!DOCTYPE html>
    <html>
    <head lang="en">
        <meta charset="UTF-8">
        <title>zepto</title>
        <style>
            .main {
                font-size: 120%;
                color: red;
            }
        </style>
    </head>
    <body>
    <h1 id="h1">This is a heading</h1>
    
    <p>This is a paragraph.</p>
    
    <p>This is another paragraph.</p>
    <button class="btn1">切换段落的 "main" 类</button>
    <script src="zepto.min.js"></script>
    <script>
        $("button").click(function () {
            $("p").toggleClass("main");
        });
    </script>
    </body>
    </html>
    <!DOCTYPE html>
    <html>
    <head lang="en">
        <meta charset="UTF-8">
        <title>zepto</title>
        <style>
            .listitem_1, .listitem_3 {
                color: red;
            }
    
            .listitem_0, .listitem_2 {
                color: blue;
            }
        </style>
    </head>
    <body>
    <h1 id="h1">This is a heading</h1>
    <ul>
        <li>Apple</li>
        <li>IBM</li>
        <li>Microsoft</li>
        <li>Google</li>
    </ul>
    <button class="btn1">添加或移除列表项的类</button>
    <script src="zepto.min.js"></script>
    <script>
        $("button").click(function () {
            $('ul li').toggleClass(function () {
                return 'listitem_' + $(this).index();
            });
        });
    </script>
    </body>
    </html>
  • 相关阅读:
    [luogu3334]抛硬币
    [luogu3706]硬币游戏
    [luogu4548]歌唱王国
    [hdu4652]Dice
    [atAGC013F]Two Faced Cards
    [atAGC045F]Division into Multiples
    [atAGC045E]Fragile Balls
    [atAGC045D]Lamps and Buttons
    [luogu5574]任务分配问题
    [luogu4331]数字序列
  • 原文地址:https://www.cnblogs.com/qzsonline/p/4167734.html
Copyright © 2011-2022 走看看