funnywwh
funnywwh
  • 发布:2015-02-09 09:39
  • 更新:2015-02-10 11:52
  • 阅读:1448

webview的 open()回调函数不会调用

分类:Native.js
        function activePage(o) {  
            //              var self = plus.webview.currentWebview();  

            var w = plus.webview.getWebviewById(o.targetTab);  
            if (w == null) {  
                w = plus.webview.create(o.targetTab, o.targetTab, {  
                    top: AZOON_TITLE_HEIGHT,  
                    bottom: AZOON_STATUS_HEIGHT  
                });  
                self.append(w);  

                plus.nativeUI.showWaiting('正在加载...')  
            }  
            plus.webview.hide(activeTab);  

            function onShowed() {  
                if (!inited) {  
                    inited = true;  
                    setTimeout(plus.navigator.closeSplashscreen,1000);  
                }  
                activeTab = o.targetTab;  
                plus.nativeUI.closeWaiting();  
            }  
            w.show('auto',600,onShowed);  

// onShowed();

        }  

页面显示出后,onShowed不会被调用。以上代码在<body>中。
求大神解答。

2015-02-09 09:39 负责人:无 分享
已邀请:
funnywwh

funnywwh (作者)

怎么就没有人回答呢?

funnywwh

funnywwh (作者)

最后用 w.addEventListener('loaded',onShowed);解决。
这个事件更好,还可以看到动画。

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