首页 > 解决方案 > JQuery Mobile 1.5.0 加载消息

问题描述

我使用的是 Jquery Mobile 1.3.0。由于上一版本的错误,我决定更改并使用新版本(1.5.0)。加载页面时,页面底部会出现加载文本。在以前的版本中,我使用了此代码,并且它有效:

$.mobile.loadingMessage = false;

但是,对于新版本,它不起作用。

谢谢你的帮助。

标签: javascriptjqueryjquery-mobileloadingmessage

解决方案


是的,这已经改变了。您可以覆盖全局默认设置,如下所示:

<!-- JQM theme shall be loaded before structure -->
<link rel="stylesheet" href="css/jquery.mobile-1.5.0.alpha.theme.css" />
<link rel="stylesheet" href="css/jquery.mobile-1.5.0.alpha.structure.css" />
<script type="application/javascript" src="js/jquery-3.2.1.js"></script>
<script>
    $(document).on("mobileinit", function () {
        $.mobile.loader.prototype.options.text = "";
        $.mobile.loader.prototype.options.textVisible = false;
    });
</script>
<script type="application/javascript" src="js/jquery.mobile-1.5.0.alpha.js"></script>

...但稍后您仍然可以选择根据loader需要显示消息文本:

$.mobile.loading("show", {
    text: "foo",
    textVisible: true
});

参考:http ://api.jquerymobile.com/loader/


推荐阅读