var timer;
var stoppedElement=document.getElementById("stopped"); // store element for faster access
function mouseStopped(){ // the actual function that is called
stoppedElement.innerHTML="Mouse stopped";
}
window.addEventListener("mousemove",function(){
stoppedElement.innerHTML="Mouse moving";
clearTimeout(timer);
timer=setTimeout(mouseStopped,300);
});
This fiddle detect the mouse move but when moving the mouse wheel it said that mouse is moving, can we separate between move and wheel events ?