Forum Discussion
KurtMasteller
13 years agoCommunity Member
Change mouse cursor on rollover or use a custom image for cursor
Is it possible to use a custom mouse cursor for an interaction, or change the mouse cursor to an image instead of the pointing hand?
I have been asked to do this and I can't figure out a way to m...
OrestMykyta-e8a
4 years agoCommunity Member
Here's how Nuno made his example:
1. He created the cursor images and saved them as .cur files. To create a .cur file you can find converters online such as this one: https://convertio.co/png-cur/
2. Each button has a JavaScript trigger with the following code, with the name of the correct .cur file:
var elementToChange = document.getElementsByTagName("body")[0];
elementToChange.style.cursor = "url('http://www.nuno-cardoso.pt/articulate/change_cursor/cursors/rocket.ico'), auto";
However, this code can be simplified like this:
document.body.style.cursor = "url('cursors/rocket.ico' ), auto");
This simplified code will work wherever you host the presentation while his version would only work on his website.
3. After publishing, create a folder called "cursors" inside the published output folder and place all the cursor files in there.