views:

363

answers:

2

I know it is possible to use jQuery to do something like:

$('body').css('cursor','wait');

What I want to know is: is it possible to change the cursor to a custom loading animation, such as a simple 'spinner' gif?

Many thanks in advance.

+2  A: 

You are just manipulating CSS on the fly here. See the spec — URIs are acceptable. Browser support is variable. I haven't tried it in years, but last time I did Internet Explorer required the cursors to be in .cur format.

That said, while it is possible, there are a good set of standard cursors that users recognise. It is rare that you will have thing usefully represented by a cursor that isn't covered by the standard list, and when that list does cover things it should be used so users don't have to learn a new icon.

David Dorward
The reason I want to do it is purely aesthetical. I don't think the user will have any problems recognizing what a spinning gif animation means, however I'm going to use something like :link,:visited { cursor: url(example.svg#linkcursor), url(hyper.cur), pointer }so that even if the .cur isn't recognised it will still show that something is loading.
gomezuk
+1  A: 

yes, have a look at this page

custom cursor

or this

custom cursor - 2 (easier to understand/customize i guess)

(but using non-default cursors is probably not a great idea)

gabtub