代码语言:javascript复制
//捕捉Android返回键
mui.back = function() {
// 是否存在全屏元素
var el = document.fullscreenElement || document.webkitFullscreenElement;
if(el != null) {
exitFullscreen();//退出全屏
} else {
plus.webview.currentWebview().close();//关闭当前页
}
};
//退出全屏
function exitFullscreen() {
var de = document;
if(de.exitFullscreen) {
de.exitFullscreen();
} else if(de.mozCancelFullScreen) {
de.mozCancelFullScreen();
} else if(de.webkitCancelFullScreen) {
de.webkitCancelFullScreen();
}
}