牧麟
牧麟
  • 发布:2018-03-13 11:31
  • 更新:2018-03-15 15:50
  • 阅读:1727

web转成app后,能不能实现右滑页面返回?

分类:wap2app
2018-03-13 11:31 负责人:无 分享
已邀请:
回梦無痕

回梦無痕 - 暂停服务

左滑?
是右滑返回吧?
ios上wap2app默认是可以做到右滑返回的。

牧麟

牧麟 (作者)

是右滑返回,没在ios上测试,刚接触,用android机在测试,想两个平台都能实现

牧麟

牧麟 (作者)

在M站需要右滑的页面加入以下代码,可以实现android右滑关闭窗口功能,而且效果还不错

<script type="text/javascript">  
var ws=null;  
// H5 plus事件处理  
function plusReady(){  
    ws=plus.webview.currentWebview();  
    if (ws.id!=plus.runtime.appid){  
        ws.drag({direction:'right',moveMode:'followFinger'}, {view:plus.nativeObj.View,moveMode:'follow'}, function(e){  
            //console.log('Right drag event: '+JSON.stringify(e));  
            if(e.type == 'end' && e.result) {  
                        ws.close();  
                    }  
        });  
    }  
}  
if(window.plus){  
    plusReady();  
}else{  
    document.addEventListener('plusready', plusReady, false);  
}  
</script>

该问题目前已经被锁定, 无法添加新回复