Is it possible to use JavaScript to set the cursor
attribute to the property none
if the mouse is inactive for a certain amount of time (say, five seco
This worked for me (taken from https://gist.github.com/josephwegner/1228975).
Note reference to an html element with id wrapper.
//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);
}
});
});