웹뷰 로드 - HBuilder

3168 단어
    
            (function($, doc) {
                $.init({
                    statusBarBackground: '#f7f7f7'
                });
                $.plusReady(function() {
                    plus.screen.lockOrientation("portrait-primary");//  
//                   
                    var mainPage = $.preload({
                        "id": 'main',
                        "url": 'main.html'
                    });
                    var toMain = function() {
                        $.fire(mainPage, 'show', null);
                        setTimeout(function() {
                            $.openWindow({
                                id: 'main',
                                show: {
                                    aniShow: 'pop-in'
                                },
                                waiting: {
                                    autoShow: false
                                }
                            });
                        }, 0);
                    };
                    var waiting = plus.nativeUI.showWaiting();
                    waiting.close();
//                  plus.nativeUI.toast(' ');
                    // close splash
                    setTimeout(function() {
                        //  splash
                        plus.navigator.closeSplashscreen();
                    }, 600);
                    //  enter
                    $.enterfocus('#login-form input', function() {
                        //  loginbtn 
                        $.trigger(loginButton, 'tap');
                    });
                    regButton.addEventListener('tap', function(event) {
                        $.openWindow({
                            url: 'reg.html',
                            id: 'reg',
                            preload: true,
                            show: {
                                aniShow: 'pop-in'
                            },
                            styles: {
                                //  
                                popGesture: 'hide'
                            },
                            waiting: {
                                autoShow: false
                            }
                        });
                    }, false);
                    // window 
                    window.addEventListener('resize', function() {
                        oauthArea.style.display = document.body.clientHeight > 400 ? 'block' : 'none';
                    }, false);
                    //
                    var backButtonPress = 0;
                    $.back = function(event) {
                        backButtonPress++;
                        if (backButtonPress > 1) {
                            plus.runtime.quit();
                        } else {
                            plus.nativeUI.toast(' ');
                        }
                        setTimeout(function() {
                            backButtonPress = 0;
                        }, 1000);
                        return false;
                    };
                });
            }(mui, document));
    

좋은 웹페이지 즐겨찾기