Blog Post
Ron_Katz
Community Member
Sherri. This was a great interaction. I like how the mouse changed to a colored paint brush. What is the trick to that?
SherriSagers1
4 years agoCommunity Member
Thank you Ron! I figured out how to change the cursor to an image with a JavaScript trigger, but I didn't have time to figure out how to maintain that same image when hovering over clickable objects. Here's the JavaScript to change the cursor:
var elementToChange = document.getElementsByTagName("body")[0];
elementToChange.style.cursor = "url('https://docs.google.com/drawings/d/e/2PACX-1vTXWxVZlAGnqlHraM8Zcl_X3gdVBhZSwd6e5GphZmHThpUoBJIxirqgARotDGgycyI8m5BPZQc4ws0h/pub?w=48&h=48'), auto";
You'll notice that the cursor images are pointing to a web image. I made them in Google Draw and published to the web at 48x48 pixels. I had to have one brush for each color.
var elementToChange = document.getElementsByTagName("body")[0];
elementToChange.style.cursor = "url('https://docs.google.com/drawings/d/e/2PACX-1vTXWxVZlAGnqlHraM8Zcl_X3gdVBhZSwd6e5GphZmHThpUoBJIxirqgARotDGgycyI8m5BPZQc4ws0h/pub?w=48&h=48'), auto";
You'll notice that the cursor images are pointing to a web image. I made them in Google Draw and published to the web at 48x48 pixels. I had to have one brush for each color.
- Ron_Katz4 years agoCommunity MemberThanks for sharing that script
Sent from Yahoo Mail for iPhone