layer彈出層移動端組件

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <title>layer移動端彈窗</title>
    <style>
        button{
            width:6rem;
            height:3rem;
            line-height: 3rem;
        }
    </style>
    <!-- 
        http://layer.layui.com/mobile/
        layer mobile-v2.0 
        -->
</head>
<body>
    <button id="loading">loading</button>
    <button id="toast">toast</button>
    <script src="layer.js"></script>
    <script>
        var loadingdom = document.getElementById("loading");
        loadingdom.onclick = function(){
            //loading帶文字
          layer.open({
            type: 2
            ,content: '加載中'
           /* ,time:"3"*/
          });
        };
        /*layer.open({
            type: 2
            ,content: '加載中'
          });*/


        var toastdom = document.getElementById("toast");
        toastdom.onclick = function(){
              //提示
          layer.open({
            content: 'hello layer'
            ,skin: 'msg'
            ,time: 2 //2秒後自動關閉
          });
        }
         
    </script>
</body>
</html>
相關文章
相關標籤/搜索