Link to home
Create AccountLog in
Avatar of jonatec
jonatecFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Changing Body cursor dynamically

i have an animated hourglass gif and I want to change the document.body.style.cursor in JavaScript to use my hourglass during a long search process. Is there a way in JavaScript/CSS to do this?
Avatar of hielo
hielo
Flag of Wallis and Futuna image

>>during a long search process
well, is you are clicking on a link or button, to call a function to do the search, within said function you can change the value of document.body.style.cursor  to whatever cursor type you want.
Avatar of jonatec

ASKER

I have since discovered that it can't be done for IE6 and above. You can't use an animated gif directly in JavaScript with a GIF, JPG file etc.

Basically the url property of the CSS CURSOR type only allows CUR or ANI  types. ie

.body1 {cursor: url(../images/wait01.cur), default; }
>>I have since discovered that it can't be done for IE6 and above.

should be can be done only on IE6+. I think the link above mentioned that.

ASKER CERTIFIED SOLUTION
Avatar of jonatec
jonatec
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account