Skip to content

Instantly share code, notes, and snippets.

@oliyoung
Created July 24, 2008 01:02
Show Gist options
  • Save oliyoung/1978 to your computer and use it in GitHub Desktop.
Save oliyoung/1978 to your computer and use it in GitHub Desktop.
show an animated gif whenever an AJAX called is made
Ajax.Responders.register({
onCreate: function() {
if($('busy') && Ajax.activeRequestCount>0)
Effect.Appear('busy',{duration:0.5,queue:'end'});
},
onComplete: function() {
if($('busy') && Ajax.activeRequestCount==0)
Effect.Fade('busy',{duration:0.5,queue:'end'});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment