【问题标题】:jQuery Mobile - Loading Message [duplicate]jQuery Mobile - 加载消息 [重复]
【发布时间】:2013-03-07 16:05:16
【问题描述】:

我是第一次使用 jQuery Mobile 来制作它,以便我可以滑动回到上一页,我已经设法开始工作了。

但是我注意到屏幕底部有一个很大的丑陋“正在加载”消息。谷歌搜索后,我看到了一个名为 $.mobile.hidePageLoadingMsg(); 的函数,我在 $(document).ready(function() 中添加了该函数,但加载消息仍然存在。

我怎样才能摆脱这条消息?

干杯

【问题讨论】:

    标签: jquery jquery-mobile


    【解决方案1】:

    我通过使用 jquery 选择器并隐藏元素解决了这个问题,如下所示:

    $(document).ready( function() {
        $(".ui-loader").hide();
    });
    

    希望这会有所帮助!

    【讨论】:

    • 这是一个很好的修正!谢谢!
    【解决方案2】:

    $.mobile.hidePageLoadingMsg();的正确用法是通过触发$.mobile.showPageLoadingMsg();手动显示Loading Message。

    来源:JQM

    在您的情况下,如果您想禁用此功能,请在<head> 标签中插入以下代码BEFORE加载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>
    

    【讨论】:

    • 干杯,它的工作。我仍然有消息所在的空白区域,有什么想法可以摆脱这个吗?
    • 加载 div 仍然存在。它需要被删除,但是,它不应该显示。如果可能的话,你能发布你的代码和照片吗?
    • 我最后用这个修复了它:$(document).bind("mobileinit", function(){ $.mobile.hidePageLoadingMsg(); });。现在来弄清楚为什么隐藏/显示不再起作用!
    • 废掉那个,这把它弄坏了,所以为什么消息消失了,grr!
    • 你修好了还是什么?
    【解决方案3】:

    加载中

    如果以上是您所说的问题,请确保您已加载样式表

    &ltlink rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css"&gt

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-03
      • 1970-01-01
      • 1970-01-01
      • 2013-04-09
      • 1970-01-01
      • 1970-01-01
      • 2012-11-26
      • 2017-10-12
      相关资源
      最近更新 更多