Your initial problem is that hiding the mouse starts mousemove
and thus immediately resets it back to default. So you could solve it like this ...
var justHidden = false; $(document).ready(function() { var j; $(document).mousemove(function() { if (!justHidden) { justHidden = false; console.log('move'); clearTimeout(j); $('html').css({cursor: 'default'}); j = setTimeout('hide();', 1000); } }); }); function hide() { $('html').css({cursor: 'none'}); justHidden = true; }
... BUUUUUT ...
You are facing a problem that now seems insoluble to me. That is, the hidden mouse does not start mousemove
ever, therefore, as soon as it is hidden, you will not be able to display it, as far as I can tell.
I will continue the investigation to see if there is a solution that I am missing.
mVChr source share