• 16、Semantic-UI之模态窗口


    16.1 定义模态窗口

    示例:定义基础的模态窗口

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Semantic UI </title>
        <!-- 使用CDN导入js和css 文件-->
        <link href="https://cdn.bootcss.com/semantic-ui/2.3.1/semantic.css" rel="stylesheet">
        <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
        <script src="https://cdn.bootcss.com/semantic-ui/2.3.1/semantic.js"></script>
        <script>
            $(function () {
                $(".ui.green.button").on("click",function () {
                    $(".ui.modal").modal("show");
                })
            })
        </script>
    </head>
    <body style="padding: 20px;">
        <div class="ui container">
            <div class="ui modal">
                <div class="header"><i class="user icon"></i>用户信息</div>
                <div class="content">
                    <p>Staryjie,您好,欢迎来到XXXX!</p>
                </div>
            </div>
            <button class="ui green button">查看</button>
        </div>
    </body>
    </html>
    

    示例:为模态窗口添加关闭按钮

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Semantic UI </title>
        <!-- 使用CDN导入js和css 文件-->
        <link href="https://cdn.bootcss.com/semantic-ui/2.3.1/semantic.css" rel="stylesheet">
        <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
        <script src="https://cdn.bootcss.com/semantic-ui/2.3.1/semantic.js"></script>
        <script>
            $(function () {
                $(".ui.green.button").on("click",function () {
                    $(".ui.modal").modal("show");
                })
            })
        </script>
    </head>
    <body style="padding: 20px;">
        <div class="ui container">
            <div class="ui modal">
                <i class="close icon"></i>
                <div class="header"><i class="user icon"></i>用户信息</div>
                <div class="content">
                    <p>Staryjie,您好,欢迎来到XXXX!</p>
                </div>
            </div>
            <button class="ui green button">查看</button>
        </div>
    </body>
    </html>
    

    示例:设置模态窗口的大小

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Semantic UI </title>
        <!-- 使用CDN导入js和css 文件-->
        <link href="https://cdn.bootcss.com/semantic-ui/2.3.1/semantic.css" rel="stylesheet">
        <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
        <script src="https://cdn.bootcss.com/semantic-ui/2.3.1/semantic.js"></script>
        <script>
            $(function () {
                $(".ui.green.button").on("click",function () {
                    $(".ui.modal").modal("show");
                })
            })
        </script>
    </head>
    <body style="padding: 20px;">
        <div class="ui container">
            <div class="ui tiny modal">
                <i class="close icon"></i>
                <div class="header"><i class="user icon"></i>用户信息</div>
                <div class="content">
                    <p>Staryjie,您好,欢迎来到XXXX!</p>
                </div>
            </div>
            <button class="ui green button">查看</button>
        </div>
    </body>
    </html>
    
  • 相关阅读:
    SpreadJS 复制行
    RookeyFrame 模块 线上创建的模块 迁移到 线下来
    RookeyFrame 附件 上传附件
    RookeyFrame 字典 新增和绑定
    RookeyFrame Bug 表单管理 -> 查看表单 ->编辑字段页面 JS报错
    Catalan数
    美元汇率
    5倍经验日
    二分查找的边界问题
    线段覆盖5
  • 原文地址:https://www.cnblogs.com/jie-fang/p/10279573.html
Copyright © 2020-2023  润新知