Fade out mouse cursor when inactive (with jQuery)

BoTGoD

New Member
I have an element with class \[code\]fade-object\[/code\] that fades out when the mouse is inactive for a certain amount of time (5000 milliseconds in this case), and fades back in when the mouse is moved again.This is the code I'm using:\[code\] var timer; $(document).mousemove(function() { if (timer) { clearTimeout(timer); timer = 0; } $('.fade-object').fadeIn(); timer = setTimeout(function() { $('.fade-object').fadeOut() }, 5000) })\[/code\]How do I make it so the mouse cursor fades out the same way (after 5000 milliseconds) and fades back in as soon as it's moved again, in sync with the div with class \[code\]fade-object\[/code\]?
 
Back
Top