I agree with Mike - especially considering that its impossible to know
that an AJAX operation will take less than 1 second to complete -
preemptively stopping a spinner from firing may cause more problems
than it's work.
With that said, here is how I would do it:
var doSpinner = true;
$(document).ajaxStart(function(){
if ( doSpinner )
// Show spinner
});
// ... when you want to stop it:
doSpinner = false;
$.get( ... );
doSpinner = true;
--John
On 8/13/06, Michael Geary <[EMAIL PROTECTED]> wrote:
> > $().ajaxStart( function ) and $().ajaxStop() are great to
> > show/hide a global Ajax activity image/message. But sometimes
> > it would be nice to temporarily inactivate this functions.
> > E.g when you have a very short Ajax request, showing an image
> > for a second or so is more annoying then really helping the user.
> > So I'm wondering if there is an easy way to inactivate
> > ajaxStart and ajaxStop for certain Ajay request temporarily.
> > If not, maybe this would be something to include in a future
> > version of jQuery...
>
> Isn't that something you could easily do yourself in your callback function?
> Set a global flag and check it.
>
> How would adding this to jQuery make it any easier?
>
> -Mike
>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
--
John Resig
http://ejohn.org/
[EMAIL PROTECTED]
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/