jq layer插件使用

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<div class="div1" style="width:50px;border:1px solid #ddd;text-align:center">cc</div>
</body>
<script src="jquery-1.11.3.min.js"></script>
<script src="layer.js"></script>
<script>
    $(".div1").on("click",function(){
        var val=$(this).html();
        switch (val){
            case "aa":
                layer.open({
                    type: 1,
                    area: ['600px', '360px'],
                    shadeClose: true, //点击遮罩关闭
                    content: '\<\div style="padding:20px;">自定义内容\<\/div>'
                });
                break;
            case "bb":
                layer.open({
                    type: 2,
                    title: 'iframe父子操作',
                    maxmin: true,
                    shadeClose: true, //点击遮罩关闭层
                    area : ['600px' , '320px'],
                    content: 'iframe.html'
                });
                break;
            case "cc":
                layer.tips('Hello tips!', '.div1');
                break;
            default:
                layer.msg("666");
        }

    })

</script>
</html>

 

posted @ 2016-08-08 16:23  dongxiaolei  阅读(587)  评论(0编辑  收藏  举报