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.
$('#loading').bind('ajaxStart', function() { var n = $(this); n.data('state', 'started'); setTimeout(function() { if (n.data() && n.data().state == 'started') { n.slideDown(500); } }, 300); }).bind('ajaxStop', function() { var n = $(this); n.data('state', 'stopped'); n.slideUp(500); });
以上是关于jqueryajax请求的绑定throbber div的主要内容,如果未能解决你的问题,请参考以下文章
css Drupal 7:隐藏视图ajax progress loader / throbber