首页 > 代码库 > mui蒙版使用例子

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>

<link href="http://www.mamicode.com/css/mui.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="http://www.mamicode.com/css/iconfont.css"/>
<script src="http://www.mamicode.com/js/mui.min.js"></script>
<script type="text/javascript" charset="utf-8">

</script>
</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="show()">点击测试</button>
</div>
<script type="text/javascript">
mui.init();
function show(){
var mask = mui.createMask(callback);//callback为用户点击蒙版时自动执行的回调;
mask.show();//显示遮罩
}
function callback(){
mui.toast(‘蒙版关闭‘);
}

</script>

</html>

mui蒙版使用例子