Change mouse cursor in OSWeb?
Hi all,
Does anyone know a way to change the mouse cursor in OSWeb? I've tried inline_javascript to set
cursor: crosshair !important;
on various elements and it doesn't seem to work. At least part of this seems to be that the value in the canvas is reset to "cursor: none" (or "cursor: default" if the show cursor property is set for a mouse response).
Any ideas would be greatly appreciated!
Cheers,
Alisdair
Comments
It's not very elegant, but I solved this with two inline_javascript items, one to add a new style tag and one to remove. So before the items where you want the different cursor, an inline_javascript with:
const style = document.createElement("style"); style.innerHTML = "canvas { cursor: crosshair !important; }"; style.id = "cursor-style-temp"; document.head.appendChild(style);And after, an inline_javascript with:
const cursor_style = document.getElementById("cursor-style-temp"); document.head.removeChild(cursor_style);Thanks or sharing!