zoukankan      html  css  js  c++  java
  • <jquery>基本的模态框

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>自定义模态</title>
        <style>
            .cover {
                position: absolute;
                background-color: rgba(0, 0, 0, 0.4);
                top: 0;
                right: 0;
                left: 0;
                bottom: 0;
                z-index: 998;
            }
    
            .modal {
                height: 400px;
                 600px;
                background-color: white;
                position: absolute;
                top: 50%;
                left: 50%;
                margin-left: -300px;
                margin-top: -200px;
                z-index: 1000;
            }
    
            .hide {
                display: none;
            }
        </style>
    </head>
    <body>
    <button id="b1">屠龙宝刀,点击就送</button>
    <button id="b2">油腻的师姐,在哪里</button>
    <div class="cover hide"></div>
    <div class="modal hide">
        <form action="">
            <p>
                <label for="">用户名:
                    <input type="text">
                </label>
            </p>
            <p>
                <label for="">密码:
                    <input type="password">
                </label>
            </p>
            <p>
                <input type="submit" value="登录">
                <input id="cancel" type="button" value="取消">
            </p>
        </form>
    </div>
    <script src="jquery-3.2.1.min.js"></script>
    <script>
        //找出标签
        $("#b1,#b2").click(function () {
            //把cover和modal展示出来
            $(".cover").removeClass("hide");
            $(".modal").removeClass("hide");
        })
        $("#cancel").click(function () {
            $(".cover").addClass("hide");
            $(".modal").addClass("hide");
    
        })
    </script>
    </body>
    </html>
    

      

  • 相关阅读:
    弱口令扫描.python脚本
    扫描web目录的Python小脚本
    Linux /etc目录重要文件
    linux(centos7)系统优化
    泛型程序设计
    对象包装器与自动装箱
    打包apk时,提示:error: Error: Resource is not public.
    SpringMVC分页实现
    IDEA搭建基于maven 的SSM框架
    ssm框架搭建
  • 原文地址:https://www.cnblogs.com/shuimohei/p/10502736.html
Copyright © 2011-2022 走看看