Re:Retro nostalgia and why my new website looks like Window ...
by jaflo on Saturday April 17, 2021 @04:45PM
(#26847310)
The approach I have seen is to apply the cursor you want to the entire body using JS so even if your cursor momentarily escapes the element the wanted cursor is shown. You just need to make sure to revert back to the default cursor when the users stops dragging or the window loses focus.
[ Parent
| on HN ]
Re:Retro nostalgia and why my new website looks like Window ...
by jancsika on Sunday April 18, 2021 @09:57AM
(#26852523)
Thanks, jaflo. I use the JS body approach, but I was hoping I was missing a declarative option.
Even JS has the PointerEvent so that you can encapsulate behaviors like dragging inside a single DOM element without having to set state for a parent element like body. I was hoping CSS had something analogous (though I can't currently think of how it would work).