Mui-遮罩模板

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <script src="js/mui.min.js"></script>
    <link href="css/mui.min.css" rel="stylesheet"/>
    <script type="text/javascript" charset="utf-8">mui.init();</script>
    <style type="text/css">/*修改自定義模板樣式*/
        .mui-backdrop {
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            z-index: 998;
            background-color: rgba(255,0,0,.3);
                        }
    </style>
</head>
<body>
    <header class="mui-bar mui-bar-nav"><!--頂部導航欄-帶返回鍵-->
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
        <h1 class="mui-title">測試屬性</h1>
    </header>
    <div class="mui-content">
        <button type="button" onclick="showMask();">遮罩事件</button>
    </div>
    <script type="text/javascript">/*遮罩蒙版*/
        function showMask(){/*綁定處理事件*/
            var mask = mui.createMask(callback);/*建立蒙版,保存到mask中;callback1-做用是點擊蒙版執行結束*/
            mask.show();/*調用展現屬性*/
        }
        function callback(){
            /*mask.close();//關閉遮罩*/
            mui.toast('您取消了操做');
        }
    </script>
</body>
</html>

相關文章
相關標籤/搜索