Commit 4ebed9a1 authored by hbcui1984's avatar hbcui1984

支持iOS平台侧滑关闭手势操作

parent 7a9c7f1a
...@@ -485,10 +485,13 @@ ...@@ -485,10 +485,13 @@
//预加载下拉刷新 //预加载下拉刷新
$.preload({ $.preload({
id:"examples/pullrefresh-main.html", id:"examples/pullrefresh-main.html",
url:"examples/pullrefresh-main.html" url:"examples/pullrefresh-main.html",
styles:{
popGesture:"hide"
}
}); });
var template = plus.webview.create('examples/template.html', 'demoTemplate'); var template = plus.webview.create('examples/template.html', 'demoTemplate',{popGesture:"hide"});
var subWebview = plus.webview.create('examples/accordion.html', 'template_sub', { var subWebview = plus.webview.create('examples/accordion.html', 'template_sub', {
top: '48px', top: '48px',
bottom: '0px' bottom: '0px'
...@@ -521,7 +524,8 @@ ...@@ -521,7 +524,8 @@
id: id, id: id,
url: this.href, url: this.href,
styles: { styles: {
zindex: 9999 zindex: 9999,
popGesture:"none"
}, },
waiting:{ waiting:{
autoShow:false autoShow:false
...@@ -544,17 +548,21 @@ ...@@ -544,17 +548,21 @@
} }
}else{ }else{
if (id&&~id.indexOf('.html')) { if (id&&~id.indexOf('.html')) {
var title = this.innerText; var title = this.innerText;
template.evalJS("with(document.getElementById('title')){innerHTML='" + title + "';className='mui-title mui-fadein';};"); template.evalJS("with(document.getElementById('title')){innerHTML='" + title + "';className='mui-title mui-fadein';};");
if(subWebview.getURL()==this.href){ if(subWebview.getURL()==this.href){
subWebview.show(); subWebview.show();
}else{ }else{
//为了适应ios的侧滑关闭,需要手动隐藏;
if ($.os.ios){
subWebview.hide("none");
}
subWebview.loadURL(this.href); subWebview.loadURL(this.href);
} }
template.show('slide-in-right', 150); template.show('slide-in-right', 150);
} }
} }
}); });
}); });
})(mui); })(mui);
......
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