tags:

views:

106

answers:

1

Hi,

i want to show the cursor "progess" on every load.

Is it possible to say: when browser is busy -> do something?

if not, is it possible to say: if jquery posting -> do something ...without to add code to every jquery post function?

I search a clean and global solution. Hope somebody can help me.

Thanks in advance! Peter

+1  A: 

try:

$().ajaxStart(function(){
   $('body').css('cursor', 'wait');
});

$().ajaxStop(function(){
   $('body').css('cursor', 'auto');
});

and it will invoked when an ajax process called...

Vaibhav Gupta
The `cursor` value you're looking for is `wait` or `progress`, not `busy`. http://reference.sitepoint.com/css/cursor
Yi Jiang
Hmm, i get an error: $.ajaxStart is not a function
Peter
example -> http://www.jsfiddle.net/V9Euk/474/
Peter
@Yi Jiang: yes edited..
Vaibhav Gupta
@Peter: are u executing an ajax request??because it will invoked when an ajax process called...
Vaibhav Gupta
Hi Vaibhav Guptam,works now, but dont ask me why oO
Peter
dude am not Guptam, am Gupta... :D
Vaibhav Gupta