I've seen examples where you can change it to preset images that your operating system has; example:
$('body').css('cursor', 'wait');
But how about my own /img/my_image.png?
Thanks for any help.
You cannot move the actual mouse pointer in Javascript. You can, however move a pointer shaped image and pretend that you can. :-) Better yet, you can move a cat image around, following the mouse cursor, and try to use it to chase the cursor into the position you want.
You can, by specifying a url to it in CSS:
div {
cursor: url(smiley.gif), url(myBall.cur), auto;
}
See http://www.w3schools.com/cssref/pr_class_cursor.asp
The Jquery way to set a custom cursor (or default cursor as a fallback):
$('selector').css({'cursor': 'url(/cursors/customMoveCursor.cur), default'});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With