jQuery Mobile 加载消息 [英] jQuery Mobile loading message

查看:18
本文介绍了jQuery Mobile 加载消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将 jQuery Mobile 链接到我的页面时,页面底部会出现某种加载消息,我无法摆脱它.我试过 $.mobile.pageLoading(true) 但没用.

When I linked jQuery Mobile to my page, some sort of loading message appeard in the bottom of the page and I can't get a rid of it. I've tried $.mobile.pageLoading(true) but it didn't work.

我应该如何删除它?我没有在任何地方打印过.

How should I remove it? I haven't printed it anywhere.

推荐答案

1.4 加载器文档

1.4 文档建议与 Loader 小部件进行交互.页面顶部描述了全局更改选项,但可以在逐个链接的基础上进行细微调整.这也可能有效:

The 1.4 loader documentation

The 1.4 documentation suggests interaction with the Loader widget. The top of the page describes globally changing the option but it can be nuanced on a link-by-link basis. This may also work:

$( document ).on( "mobileinit", function() {
    $.mobile.loader.prototype.options.disabled = true;
});

另外,根据 http://demos.jquerymobile.com/1.4.5/loader/http://api.jquerymobile.com/loader/,您可以使用以下代码隐藏加载体验:>

Also, according to http://demos.jquerymobile.com/1.4.5/loader/ and http://api.jquerymobile.com/loader/, you can hide the loading experience with the following code:

// As submitted by @Aras
$.mobile.loading( "hide" );
// (or presumably as submitted by @Pnct)
$.mobile.loading().hide();

选项 B - 禁用 AJAX 加载

禁用 AJAX 加载将有效地删除消息.

Option B - disable AJAX loading

Disabling AJAX loading will effectively remove the message.

如果您不希望页面受益于在后台加载然后显示,您可以通过指定 data-ajax='false' 在您不想看到加载消息的任何锚点 () 标签上.您还可以使用全局设置使所有链接正常"加载.

If you don't want a page to benefit from loading in the background and then showing, you can make it load like 'normal' by specifying the data-ajax='false' on whatever anchor (<a...>) tag you don't want to see a loading message for. There's also a global setting you can use to make all links load 'normally'.

要全局禁用(请务必阅读此页面以了解含义和他们的建议.新文档可能没有警告):

To disable globally (be sure to read this page to understand implications and their recommendations. The new docs may not have warnings):

$.mobile.ajaxEnabled=false;

选项 C - 隐藏它

如果你想使用 1.4 Load Page 方法来加载外部页面,它有一个选项可用对于 showLoadMsg,您可以简单地将其设置为 false.

Option C - just hide it

If you want to use the 1.4 Load Page approach to load external pages, it has an option available for showLoadMsg which you can simply set to false.

全局选项(在早期版本中可用——至少 1.0、1.1 和 1.2——阅读它此处) 仅用于删除消息:

The global option (available in earlier versions -- at least 1.0, 1.1, and 1.2 -- read about it here) for just removing the message is:

$.mobile.loadingMessage = false;

1.2 和之前的文档说,如果您将其设置为 false,则不会显示加载消息.

The 1.2 and prior documentation says that if you set it to false, no loading message will be shown.

这篇关于jQuery Mobile 加载消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆