js check for mouse event code example
Example 1: javascript detect right click
el.addEventListener('contextmenu', function(ev) {
ev.preventDefault();
alert('success!');
return false;
}, false);
Example 2: javascript mouse events
element.addEventListener("mousemove", function(event) {
console.log(event);
}); //Calls function every time the mouse moves over 'element'