Discuz!NT|BBS|论坛

注册

 

发新话题 回复该主题

layer插件如何弹出自定义div [复制链接]

1#
<!DOCTYPE HTML><html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="jquery-1.9.1.min.js"></script>
        <script src="layer/layer.js"></script>

        <script>
            $(function () {
                $("a").click(function () {
                    layer.open({
                        type: 1,
                        closeBtn: false,
                        shift: 2,
                        shadeClose: true,
                        content: $("#box1")
                    });
                })
            })
        </script>

        <style>
            *{padding:0; margin: 0;}
            #box1{width:555px; height:600px; background: #eee; display:none;}
        </style>
    </head>
    <body>
        <a href="#">点击</a>
        <div id="box1">
            111
        </div>
    </body>
</html>
分享 转发
TOP
发新话题 回复该主题