<script type="text/javascript" charset="utf-8"> //mui初始化 mui.init({ swipeBack: true //啓用右滑關閉功能 }); var info = document.getElementById("info"); document.getElementById("alertBtn").addEventListener('tap', function() { mui.alert('歡迎使用Hello MUI', 'Hello MUI', function() { info.innerText = '你剛關閉了警告框'; }); }); document.getElementById("confirmBtn").addEventListener('tap', function() { var btnArray = ['否', '是']; mui.confirm('MUI是個好框架,確認?', 'Hello MUI', btnArray, function(e) { if (e.index == 1) { info.innerText = '你剛確認MUI是個好框架'; } else { info.innerText = 'MUI沒有獲得你的承認,繼續加油' } }) }); document.getElementById("promptBtn").addEventListener('tap', function(e) { e.detail.gesture.preventDefault(); //修復iOS 8.x平臺存在的bug,使用plus.nativeUI.prompt會形成輸入法閃一下又沒了 var btnArray = ['取消', '肯定']; mui.prompt('請輸入你對MUI的評語:', '性能好', 'Hello MUI', btnArray, function(e) { if (e.index == 1) { info.innerText = '謝謝你的評語:' + e.value; } else { info.innerText = '你點了取消按鈕'; } }) }); document.getElementById("toastBtn").addEventListener('tap', function() { mui.toast('歡迎體驗Hello MUI'); }); </script>