MUI monitors physical return keys for Android phones and some common configurations

Source: Internet
Author: User

<! DOCTYPE html>
<meta charset= "UTF-8" >
<title></title>
<link rel= "stylesheet" type= "Text/css" href= "Css/mui.css"/>
<style type= "Text/css" >
. mui-card-content{
padding-bottom:20px;
}
button{
margin-top:20px;
margin-left:20px;
}
</style>
<body>
<div class= "Mui-card" >
<!--header, placing the title---
<div class= "Mui-card-header" > Header </div>
<!--content area--
<div class= "Mui-card-content" >
<button type= "button" class= "mui-btn mui-btn-blue mui-btn-outlined" id= "alertbtn" > Warning box </button>
<button type= "button" class= "mui-btn mui-btn-blue mui-btn-outlined" id= "confirmbtn" > Confirmation box </button>
<button type= "button" class= "mui-btn mui-btn-blue mui-btn-outlined" id= "promptbtn" > Input dialog Box </button>
<button type= "button" class= "mui-btn mui-btn-blue mui-btn-outlined" id= "toastbtn" > Auto vanishing Prompt box </button>
</div>
<!--footer, placing supplemental information or supported actions--
<div class= "Mui-card-footer" > Footer </div>
</div>
<!--<script src= ". /jquery-2.1.0.js "type=" Text/javascript "charset=" Utf-8 "></script>-->
<script src= "Js/mui.js" type= "Text/javascript" charset= "Utf-8" ></script>
<script type= "Text/javascript" >
Mui.init ({
Swipeback:true,//enable right slide off function
Beforeback:function () {//Listen for physical return key method
Get the WebView of the list interface
var list = plus.webview.getWebviewById (' list ');
Triggers a custom event (refresh) of the list interface for data refresh
Mui.fire (list, ' Refresh ');
Returns true to continue the page close logic
return true;
}
});

document.getElementById ("Alertbtn"). AddEventListener (' tap ', function () {
Mui.alert (' Welcome to Hello Mui ', ' Hello Mui ', function () {
Mui.toast (' You just closed the warning box ')
});
});

document.getElementById ("Confirmbtn"). AddEventListener (' tap ', function () {
var btnarray = [' No ', ' yes '];
Mui.confirm (' MUI ' is a good frame, OK? ', ' Hello MUI ', Btnarray, function (e) {
if (E.index = = 1) {
Mui.toast (' You just confirmed that MUI is a good frame ')
} else {
Mui.toast (' MUI does not get your approval, continue refueling ')
}
})
});

document.getElementById ("Promptbtn"). AddEventListener (' tap ', function (e) {
E.detail.gesture.preventdefault (); Fixed a bug in iOS 8.x platform, using plus.nativeUI.prompt will cause the input method flash and gone.
var btnarray = [' Cancel ', ' OK '];
Mui.prompt (' Please enter your comments on MUI: ', ' good performance ', ' Hello MUI ', Btnarray, function (e) {
if (E.index = = 1) {
Mui.toast (' Thank you for your comments: ' + e.value ')
} else {
Mui.toast (' You clicked the Cancel button ')
}
})
});

document.getElementById ("Toastbtn"). AddEventListener (' tap ', function () {
Mui.toast (' Welcome to the Hello MUI ');
});
</script>
</body>

MUI monitors physical return keys for Android phones and some common configurations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.