Wednesday, June 5, 2024
173
rated 0 times [  175] [ 2]  / answers: 1 / hits: 37338  / 14 Years ago, thu, march 3, 2011, 12:00:00

I have this page that does some funky database stuff that takes a couple seconds to process, and in the meantime I'd like to set a wait cursor so the user doesn't flip out and keep clicking the button. I've looked at the



document.body.style.cursor = wait



thing, the problem with this is that it only works when the mouse is over the body of the page (i.e. still shows normal pointer if it's over a button). How can I set it so that no matter where the mouse is on the page, it shows a wait icon?



A second part to this question is, once it's done it's thing, how do I set it back? If I set it back to default, this seems to override any hover cursor changes I had set in my CSS (so it no longer becomes a hand when over a specified object, etc.).



EDIT: the first answer works nicely, except in IE it doesn't refresh the cursor (so you notice the change of cursor type) until you actually move the cursor. Any fixes?


More From » mouse-cursor

 Answers
52

For your first problem, try using cursor: wait !important;.



For your second problem, the default cursor for elements is cursor: auto;, not cursor: default; or cursor: inherit;.


[#93484] Tuesday, March 1, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
erick

Total Points: 588
Total Questions: 92
Total Answers: 100

Location: Bangladesh
Member since Sat, Jan 23, 2021
3 Years ago
erick questions
;