2016-04-26 73 views
0

我遇到問題了$.mobile.loading正常工作......它工作正常很長一段時間,並且自從我將iOS更新爲最後一個版本(9.x),它部分工作。我的意思是,有時它可以工作,並顯示加載消息,但大多數情況下它不顯示任何內容。我正在運行iOS 9.1.3並在Safari和Firefox iOS上進行測試。

我測試過的iPhone 4S仍舊運行在ios 6.x上,加載程序工作正常!

此外,它在Android下工作。在我的電腦上進行測試,它在Chrome和Firefox上工作,但不適用於Safari。

在最新版本的Safari/iOS中是否存在涉及jQuery/jQuery Mobile的已知錯誤?

這裏是我的代碼:

function showLoadingPage() { 
    $('body').append("<div class='ui-loader-background' onClick='$.mobile.loading(\"hide\");'> </div>"); //Fond opaque lors du chargement 

    var $this = $(this), 
     //theme = $this.jqmData("theme") || $.mobile.loader.prototype.options.theme, 
     theme = "b", 
     //msgText = $this.jqmData("msgtext") || $.mobile.loader.prototype.options.text, 
     msgText = "Chargement ...", 
     //textVisible = $this.jqmData("textvisible") || $.mobile.loader.prototype.options.textVisible, 
     textVisible = true, 
     textonly = !!$this.jqmData("textonly"), 
     html = $this.jqmData("html") || ""; 
    $.mobile.loading('show', { 
      text: msgText, 
      textVisible: textVisible, 
      theme: theme, 
      textonly: textonly, 
      html: html 
    }); 
} 

$(document).on("click", ".show-page-loading-msg", function() { showLoadingPage(); }); 

當我點擊它的類show-page-loading-msg一個鏈接,它應該引發$.mobile.loading

回答

0

添加一個小延遲來幫助加載程序顯示。

setTimeout(function() {  
    $.mobile.loading('show'); 
}, 10); 
+0

還不行:/ –

+0

這[小提琴](https://jsfiddle.net/da7y5vcL/2/)的作品在我的iPhone版本9.3.1。你能檢查出來嗎? –

+0

適用於我。但當鏈接指向另一個頁面時,它似乎不起作用。無法在小提琴上進行驗證。試試這裏:http://hortistock.fleurondanjou.fr/testloader.php –