【问题标题】:Jquery mobile. Loading message on page changejQuery手机。在页面更改时加载消息
【发布时间】:2012-06-22 07:45:32
【问题描述】:

我正在使用 Phonegap + JQM 构建离线应用程序。是否有可能在每个页面更改事件上全局设置显示加载消息?

【问题讨论】:

    标签: jquery-mobile cordova page-loading-message


    【解决方案1】:
    $(document).live('pagebeforehide', function(){
        $.mobile.showPageLoadingMsg();
        //More stuff to do
    });
    
    $(document).live('pageshow', function(){
        //More stuff to do
        $.mobile.hidePageLoadingMsg();
    });
    

    【讨论】:

    • 我遇到了这种错误,然后我启动了这个解决方案“Uncaught TypeError: Object # has no method 'hidePageLoading'”
    【解决方案2】:

    Nirmal 的回答对我不起作用,但绑定到各个页面可以:

    $("div[data-role='page']").live('pagebeforehide', function(){
        console.log("showing....");
        $.mobile.showPageLoadingMsg();
        //More stuff to do
    });
    
    $("div[data-role='page']").live('pageshow', function(){
        //More stuff to do
        console.log("hiding....");
        $.mobile.hidePageLoadingMsg();
    });
    

    jsFiddle - look at the logs, sometimes it's too fast to see

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-05-15
      • 2014-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多