我第一次使用jQuery Mobile,以便我可以滑回前一頁,我已設法使其工作。jQuery Mobile - 正在加載消息
但是我注意到屏幕底部有一個很大的難看的「加載」消息。谷歌搜索後,我看到一個名爲$.mobile.hidePageLoadingMsg();
的函數,我在$(document).ready(function()
中添加了該函數,但加載消息仍然存在。
我該如何擺脫此消息?
乾杯
我第一次使用jQuery Mobile,以便我可以滑回前一頁,我已設法使其工作。jQuery Mobile - 正在加載消息
但是我注意到屏幕底部有一個很大的難看的「加載」消息。谷歌搜索後,我看到一個名爲$.mobile.hidePageLoadingMsg();
的函數,我在$(document).ready(function()
中添加了該函數,但加載消息仍然存在。
我該如何擺脫此消息?
乾杯
的$.mobile.hidePageLoadingMsg();
正確用法是通過觸發$.mobile.showPageLoadingMsg();
手動顯示正在加載消息。
來源:JQM
在你的情況,如果你想禁用此功能,插入下面的代碼在<head>
標籤前裝載JQM <script src="Jquery.mobile.1.2.0.js">
代碼:
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<!-- disable loading msg -->
<script>
$(document).bind("mobileinit", function(){
$.mobile.loadingMessage = false;
});
</script>
<!--/-->
<script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script>
</head>
我通過使用jQuery選擇器和隱藏元素來解決問題,如下所示:
$(document).ready(function() {
$(".ui-loader").hide();
});
希望這有助於!
這是一個很好的修復!謝謝! – BartSabayton 2015-04-23 08:55:43
如果上面是你在談論確保你已經在樣式表加載
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css">
乾杯,其工作的問題。我仍然有一個空白的地方,但是有什麼想法如何擺脫這個? – Elliot 2013-03-07 16:44:44
加載div仍然存在。它需要被刪除,但是,它不應該顯示。如果可能,你可以發佈你的代碼和照片嗎? – Omar 2013-03-07 16:50:58
我在最後修正了它:$(document).bind(「mobileinit」,function(){$ .mobile.hidePageLoadingMsg();});.現在解決爲什麼隱藏/顯示不再有效! – Elliot 2013-03-07 16:53:50