Hide your cursor on a web page when it is idle. Great if you're using a web page for some sort of TV Display and don't want the cursor messing things up.
//Requires jQuery - http://code.jquery.com/jquery-1.6.4.min.js | |
$(document).ready(function() { | |
var idleMouseTimer; | |
var forceMouseHide = false; | |
$("body").css('cursor', 'none'); | |
$("#wrapper").mousemove(function(ev) { | |
if(!forceMouseHide) { | |
$("body").css('cursor', ''); | |
clearTimeout(idleMouseTimer); | |
idleMouseTimer = setTimeout(function() { | |
$("body").css('cursor', 'none'); | |
forceMouseHide = true; | |
setTimeout(function() { | |
forceMouseHide = false; | |
}, 200); | |
}, 1000); | |
} | |
}); | |
}); |
This comment has been minimized.
This comment has been minimized.
@leolord are you familiar with JQuery's |
This comment has been minimized.
This comment has been minimized.
My situation might be a bit weird, but I found I needed to add this CSS to make this work in Firefox:
|
This comment has been minimized.
This comment has been minimized.
Okay, but how can I stop the mouse hiding? |
This comment has been minimized.
This comment has been minimized.
should be able to just move your mouse. It automatically unhides with movement. |
This comment has been minimized.
This comment has been minimized.
It should only work on fullscreen ... on normal screen the function should stop. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
There is a problem that I want hide cursor while people scrolling the window. It seams impossible.