jqueryajax请求的绑定throbber div

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jqueryajax请求的绑定throbber div相关的知识,希望对你有一定的参考价值。

jQuery bindings for showing and hiding a div during AJAX requests. The div will not show unless the AJAX request takes a certain amount of time (in this case 300ms). This will reduce the flicker effect of showing and hiding throbbers.
  1. $('#loading').bind('ajaxStart', function() {
  2. var n = $(this);
  3. n.data('state', 'started');
  4. setTimeout(function() {
  5. if (n.data() && n.data().state == 'started') {
  6. n.slideDown(500);
  7. }
  8. }, 300);
  9. }).bind('ajaxStop', function() {
  10. var n = $(this);
  11. n.data('state', 'stopped');
  12. n.slideUp(500);
  13. });

以上是关于jqueryajax请求的绑定throbber div的主要内容,如果未能解决你的问题,请参考以下文章

HTML jquery throbber

css Drupal 7:隐藏视图ajax progress loader / throbber

[UE4]Circular Throbber,圆形的环形的动态图标

jquery中ajax的相关事件汇总

Kendo Grid - 搜索后绑定数据

jQueryAjax