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

查看:136
本文介绍了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.

如果您不希望页面从后台载入然后显示而受益,则可以通过在任意锚点()标记,您不想看到加载消息.您还可以使用一个全局设置来使所有链接正常"加载.

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 加载页面方法来加载外部页面,则可以使用一个选项对于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天全站免登陆