2

I try to figure out how to make simple Javascript custom cursor. I find couple Advanced lvl scripts, but that's not what i looking for. I will love to understand most simple way to do it in pure Javascript. I read couple of discussions here and other forums but nothing is working for me.

element.style.cursor = "url('http://bringerp.free.fr/Files/RotMG/cursor.gif'), auto";

4
  • Does your element have a width and height setting? If the element is 0 x 0, it wouldn't work. Also, it needs to have content inside it. Commented Aug 22, 2019 at 19:58
  • 2
    It might actually be easier to convert your GIF to a .cur file and then use CSS to get your custom cursor working. Commented Aug 22, 2019 at 20:05
  • Can i ask sample please? Commented Aug 22, 2019 at 20:15
  • Maybe that website image is presenting hotlinking - tried to set as the src for your profile image on this page, but the image failed to load. I don't think there is anything wrong with your javascript. Commented Aug 22, 2019 at 20:39

1 Answer 1

3

What you are trying is working if you load the external image within a page with the same protocol (http).

Save the image in your web app and load it from your own domain.

I found this page http://www.webpage-maker.com/

open the console and put this in:

document.querySelector('#container').style.cursor = "url('http://bringerp.free.fr/Files/RotMG/cursor.gif'), auto";
Sign up to request clarification or add additional context in comments.

1 Comment

I try couple of thinks, if i make my own page/localhost or host its working. But what i mean more is make custom cursor for google.com page or similar. Not mine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.