关于侧滑返回(跟手)
页面架构是这样的:
页面1 nav.html(a.href→) 页面2 settings.html(a.href→)页面3.html
然后我在 页面1.html 上写了:
<script type="text/javascript">
document.addEventListener( "plusready", SetGenshou, false );
// 扩展API加载完毕,现在可以正常调用扩展API
function SetGenshou() {
//创建webview支持侧滑返回:
//动态改变webview的侧滑返回功能:
var wv=plus.webview.currentWebview();
// 关闭侧滑返回功能
wv.setStyle({'popGesture':'none'});
}
</script>
在页面2上写了:
<script type="text/javascript">
//创建webview支持侧滑返回
var wv=plus.webview.open('nav.html','document',{'popGesture':'close'});
//动态改变webview的侧滑返回功能
var wv=plus.webview.currentWebview();
// 侧滑返回后关闭webview
wv.setStyle({'popGesture':'close'});
</script>
在页面3上写了:
<script type="text/javascript">
document.addEventListener( "plusready", SetGenshou, false );
// 扩展API加载完毕,现在可以正常调用扩展API
function SetGenshou() {
//创建webview支持侧滑返回:
var wv=plus.webview.open('settings.html','document',{'popGesture':'close'});
//动态改变webview的侧滑返回功能:
var wv=plus.webview.currentWebview();
// 侧滑返回后关闭webview
wv.setStyle({'popGesture':'close'});
}
</script>
这样的结果是:
页面2返回页面1的侧滑返回没有问题,但是在页面2上点页面3的<a>就点不开页面3,好像是点开就自动关掉了又返回了页面2。哪位能帮忙看下?
1 个回复
秦安 (作者)
自问自答一个 :原谅我的无知,改用了mui.openWindow方法,里面自带封装了侧滑返回跟手的特效,文档见:http://dev.dcloud.net.cn/mui/window/