简体   繁体   中英

How to hide or change mouse cursor in new browsers?

I was trying to create a library (plugin) for JavaScript that let users to hide mouse and change the mouse cursor with something else.

It was easy before just in CSS work with cursor , I found some plugins like this , but now I visited this website that changed mouse courser.

Why new browsers (or Operation systems) not supporting to change mouse cursor to a image?

You can change the cursor to an image but it must be a specific file type. ie .ico:

 .cursor{ position:absolute; top:0; bottom:0; left:0; right:0; cursor: url(http://davidwalsh.name/demo/css-custom-cursor.ico), default; } 
 <body><div class="cursor"></div></body> 

The image was from this website .

It works. Try:

$('html,body').css('cursor','none');

OR

<pre>
<span style="cursor:pointer">pointer</span><br>
<span style="cursor:progress">progress</span><br>
<span style="cursor:s-resize">s-resize</span><br>
<span style="cursor:none">s-Hide</span><br>
</pre>

JsFiddle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM