wersionlovewz
wersionlovewz
  • 发布:2017-03-14 09:29
  • 更新:2017-03-14 09:29
  • 阅读:1297

webview.drag滑动后回调不执行?

分类:HTML5+
var _self, _next, timer;  
mui.plusReady(function(){  
    _self = plus.webview.currentWebview();  
    _next = plus.webview.getWebviewById('sub2.html');  
    index = plus.webview.getLaunchWebview();  
    _self.drag(  
        {  
            direction : "left",  
            moveMode  : "followFinger"  
        },  
        {  
            view               : _next,  
            moveMode  : "follow"  
        },  
        function(e){  
            console.log("4.4版本安卓不会执行,5.0版本安卓能执行");  
            if(timer != null){clearTimeout(timer); }  
            timer = setTimeout(function(){  
                index.evalJS("h('#tabBar').find('a').removeClass('mui-active'); h('#navBarSecond').addClass('mui-active');");  
            }, 100);  
        }  
    );  
});

虽然不会执行回调,但是能完成滑动的效果,也是醉了
具体可以参考下 http://www.hcoder.net/tutorials/info_194.html 教程的代码,自己弄一个app例子来试试,当然用低版本的安卓来试试

2017-03-14 09:29 负责人:无 分享
已邀请:

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