I would like to enhance a depth effect by hiding the mouse cursor as it passes over a div, is there a method that will work across all browsers?
A:
You can change the type of cursor you use (pointer, help, crosshair,...) but to hide it... Even if this would be possible in modern browers, older browsers won't support this. Also I can't imagine why you would hide the cursor.
EDIT: in firefox when adding cursor:none;
to the body element it hides the cursor untill I go over a link, it's maybe a start.
krike
2010-09-08 20:24:58
mmm yeah I know of changing it to the different set states, but ideally i need nothing! Im working on a canvas mega graphic demo, and ideally need the mouse to disappear so I can the simulate it say passing underneath glass
davivid
2010-09-08 20:30:28
so actually it wouldn't need to be supported on older browsers thinking about it
davivid
2010-09-08 20:31:02
+2
A:
read: w3cschools
Looks like:
/* css */
div {
cursor: url(url/to/transparent.gif), auto;
}
should do the trick or:
divEl.style.cursor = 'url(path/to/transparent.gif), auto'; // javascript
But hiding the cursor can annoy visitors immensly.
Addendum: In the examples I wrote .gif files, but you might actually need to convert to .cur or .ani files for better browser support.
BGerrissen
2010-09-08 20:27:26
dont have opera handy either, works in FF, but not in chrome it seems. Yes it would be very annoying to hide it - I'm planning on redrawing it on a canvas but simulate it underneath things
davivid
2010-09-08 20:43:00
see w3cschools link provided in awnser: Note: Opera 9.3 and Safari 3 do not support URL values.
BGerrissen
2010-09-08 20:55:16