Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide mouse cursor with jquery

How to hide mouse cursor with jquery in entire webpage. I tried this

$(document).ready(function(){
        $(body).css({
           'cursor' : 'none'
        });
});

But this is not working in all the browsers. Is there any plugin to implement this.

Thanks in Advance.

like image 699
KillerFish Avatar asked Dec 14 '10 08:12

KillerFish


People also ask

How do I hide my cursor?

You will see a “Mouse Properties” window. At the top of this window, click the “Pointer Options” tab. The “Pointer Options” tab displays various mouse settings. Here, in the “Visibility” section, enable the “Hide Pointer While Typing” option.


2 Answers

$('body').css('cursor', 'none');
like image 126
Brian Rose Avatar answered Oct 09 '22 08:10

Brian Rose


I bet it has nothing to do with the jQuery method, but in fact the CSS for your page.

Make sure (using firebug) that the body element is actually visible on the page, the contents might because the overflow is set to auto by default, but you'll also need to set the body height and width to 100% to ensure that when you're mouse moves across the screen it actually invokes body.mouseover()

Here's a working example » http://jsfiddle.net/Ilmv/XQmqe/

like image 34
Ben Everard Avatar answered Oct 09 '22 08:10

Ben Everard