I have been trying to find out more about mouse events such as onmouseover
, onmouseout
and onmousemove
but there is not much info. It seems these event handlers by default have a single argument, the event its self.
element.onmouseover = mouseoverFunction
function mouseoverFunction( event ) {
// Do stuff here
}
However I want to be able to pass other arguments to into the function.
function mouseoverFunction( event, moreArgs ) {
// Do stuff here
}
How do I pass the event argument and additional arguments to the function?
Also is it ok to pass more arguments into an event handler function?