I am working on a browser game where I am using custom cursors. I am setting up the custom cursor for the entire page in my CSS (for some reason if I set it up for the 'body' sometimes it changes back to default cursor at some area)
html {
cursor: url("http://www.iwansfactory.com/tycoon/defaultcursor.png"), default;
}
I would like to overwrite the url property of the above CSS using javascript
For example when the user is moving the map I would like to use this custom cursor:
http://www.iwansfactory.com/tycoon/movecursor.png
How can I change this value using javascript? Thanks in advance! :)
document.documentElement.style.cursor = 'url("http://www.iwansfactory.com/tycoon/movecursor.png"), default';