CRISHK Corporation
CRISHK Corporation

Reputation: 3008

GIF loading stops when I show it

Look this code:

$('#loader').show();
$.post( '/action.php', function( data ) {  
// do anything with data
$('#loader').hide(); 
}  );

The loader DIV has a GIF image simulating loading state, This code works well but the GIF stops when is waiting the data (post called) ...

I want the gif moves ever independently of the other codes in execution.. I hope you understand my problem..

Upvotes: 2

Views: 3143

Answers (1)

T.P.
T.P.

Reputation: 2995

I believe you want the behavior listed in the example on the jQuery documentation website.

jQuery:ajaxStart

You can hide the image with the ajaxStop event handler.

Upvotes: 2

Related Questions