Commit 3f44ca3d authored by hbcui1984's avatar hbcui1984

android 4.0以下版本暂不支持透明webview遮罩

parent dd8400e3
...@@ -78,8 +78,12 @@ ...@@ -78,8 +78,12 @@
</div> </div>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
//关于backbutton和menubutton两个按键的说明,在iOS平台不存在,故需隐藏
if(!mui.os.android){ if(!mui.os.android){
document.getElementById("android-only").style.display = "none"; var span = document.getElementById("android-only")
if(span){
span.style.display = "none";
}
} }
var subWebview=null,template=null,index=null; var subWebview=null,template=null,index=null;
mui.plusReady(function () { mui.plusReady(function () {
......
...@@ -54,18 +54,22 @@ ...@@ -54,18 +54,22 @@
aniShow:'none' aniShow:'none'
} }
}); });
//创建遮罩页面; //创建遮罩页面,使用透明webview解决index页面、list页面创建div遮罩不同步的问题;
mask = mui.preload({ //android 4.0以下版本不支持透明webview,故4.0以下暂不遮罩;
id:"index-mask", if(mui.os.android&&parseFloat(mui.os.version)>4.0){
url:"index-mask.html", mask = mui.preload({
styles:{ id:"index-mask",
left:'70%', url:"index-mask.html",
width:'30%', styles:{
zindex:1, left:'70%',
opacity:0.1, width:'30%',
popGesture:"none" zindex:1,
} opacity:0.1,
}); popGesture:"none"
}
});
}
},200); },200);
}); });
...@@ -80,7 +84,7 @@ ...@@ -80,7 +84,7 @@
menu.show(); menu.show();
//显示遮罩 //显示遮罩
setTimeout(function () { setTimeout(function () {
mask.show('none'); mask&&(mask.show('none'));
},150); },150);
//主窗体开始侧滑; //主窗体开始侧滑;
mui.currentWebview.setStyle({ mui.currentWebview.setStyle({
...@@ -98,7 +102,7 @@ ...@@ -98,7 +102,7 @@
function closeMenu(){ function closeMenu(){
if(showMenu){ if(showMenu){
//关闭遮罩; //关闭遮罩;
mask.hide(); mask&&(mask.hide());
//主窗体开始侧滑; //主窗体开始侧滑;
mui.currentWebview.setStyle({ mui.currentWebview.setStyle({
left: showMenu ? '0' : '70%', left: showMenu ? '0' : '70%',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment