jquery ajax加载叠加插件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1262377/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 11:02:17  来源:igfitidea点击:

jquery ajax loading overlay plugin

jquery

提问by coool

Does anybody know of a nice plugin for ajax loading overlay preventing any other action in the browser till the data gets loaded.

有没有人知道一个很好的 ajax 加载覆盖插件,可以防止浏览器中的任何其他操作,直到数据被加载。

回答by VoteyDisciple

Try blockUI: http://malsup.com/jquery/block/

试试blockUI:http://malsup.com/jquery/block/

This doesn't have any connection to AJAX inherently, but it's something you can invoke when doing your own AJAX calls separately.

这本身与 AJAX 没有任何联系,但您可以在单独执行自己的 AJAX 调用时调用它。

回答by Nathan Bubna

i made one more tailored to this sort of thing:

我做了一个更适合这种事情的:

http://plugins.jquery.com/project/loading

http://plugins.jquery.com/project/loading

All you need to do is:

您需要做的就是:

$.loading({onAjax:true,mask:true});

That'll wire it up to ajax events automatically. There are a great many more options and features though. You can use text, arbitrary elements, apply "pulse" effects and more. Check out the demo:

这会自动将它连接到 ajax 事件。不过,还有更多的选择和功能。您可以使用文本、任意元素、应用“脉冲”效果等等。查看演示:

http://jquery-values.googlecode.com/svn/other/loading/jquery.loading.htm

http://jquery-values.googlecode.com/svn/other/loading/jquery.loading.htm

回答by LT.Nolo

回答by user1995621

You could use dojox.widget.Standby, but it requires you to mark the content for the overlay with data-dojo-type="dojox.widget.Standby"

您可以使用dojox.widget.Standby,但它要求您使用data-dojo-type="dojox.widget.Standby"

Then you only need to get the widget with: dijit.byId('id').hide()/show()

然后你只需要获取小部件: dijit.byId('id').hide()/show()

See: dojox.widget.Standby documentation

请参阅:dojox.widget.Standby 文档