开发者

GIF loading stops when I show it

开发者 https://www.devze.com 2023-01-16 03:49 出处:网络
Look this code: $(\'#loader\').show(); $.post( \'/action.php\', function( data ) { // do anything with data

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 t开发者_C百科he other codes in execution.. I hope you understand my problem..


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消