Is it possible to control the z-index
of the cursor using CSS or Javascript? It seems unlikely, but it would be interesting if it were possible.
Imagine having buttons on a webpage and wanting to overlay a semi-transparent image on top of them for a cool effect. Or in another scenario, using SVG paths with hover and click actions. If it were possible to set the button or SVG z-index
to 0, the cursor's z-index
to 1, and the image overlay's z-index
to 2, the interaction would be seamless! The mouse would appear beneath the overlay but still be able to interact with the buttons. It would be even more impressive to have a visual z-index
(the layer the cursor appears on) separate from an effective z-index
(the actual layer of the cursor). This way, the cursor could look like it's on top of the overlay while still being able to interact with the buttons below.
Although this idea may raise doubts, I'm curious if anyone has ever tried something like this before.