HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>对话框 - mdui.alert()</title>
<link rel="stylesheet" href="../assets/mdui-v0.4.3/css/mdui.min.css"/>
</head>
<body class="mdui-theme-primary-indigo mdui-theme-accent-pink">
<div class="mdui-container">
<button class="mdui-btn mdui-color-theme-accent mdui-ripple" id="example-alert-1">demo1</button>
<button class="mdui-btn mdui-color-theme-accent mdui-ripple" id="example-alert-2">demo2</button>
<button class="mdui-btn mdui-color-theme-accent mdui-ripple" id="example-alert-3">demo3</button>
<button class="mdui-btn mdui-color-theme-accent mdui-ripple" id="example-alert-4">demo4</button>
</div>
<script src="../assets/mdui-v0.4.3/js/mdui.min.js"></script>
</body>
</html>
JavaScript
mdui.JQ('#example-alert-1').on('click', function(){
mdui.alert('content');
});
mdui.JQ('#example-alert-2').on('click', function(){
mdui.alert('content', 'title');
});
mdui.JQ('#example-alert-3').on('click', function(){
mdui.alert('content', 'title', function(inst){
mdui.alert('点击了确认按钮');
});
});
mdui.JQ('#example-alert-4').on('click', function(){
mdui.alert('content', function(){
mdui.alert('点击了确认按钮');
});
});