layui 无边框透明背景弹出层demo


<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" type="text/css" href="https://www.layuicdn.com/layui/css/layui.css" />
    <title>layer无边框弹窗</title>

    <style>
        .myskin
        {
            background-color: transparent;
            box-shadow: 0 0 0 rgba(0,0,0,0);
        }

        .myskin .layui-layer-setwin > .layui-layer-close2
        {
            top: -10px;
            right: 10px;
        }
    </style>
</head>
<body>
    <button class="layui-btn">点击弹窗</button>

    <script src="https://www.layuicdn.com/layui/layui.js"></script>
    <script>
        layui.use(['jquery', 'layer'], function()
        {
            var $ = layui.jquery;
            var layer = layui.layer;

            $("button").on("click", function()
            {
                layer.open(
                    {
                        type: 2,
                        title: false,
                        content: "https://www.bilibili.com",
                        skin: 'myskin',
                        area: ['100%', '100%']
                    });
            })
        })
    </script>
</body>
</html>

 

posted @ 2022-06-13 14:42  何效名  阅读(850)  评论(0编辑  收藏  举报