Is it possible to change the type
of an event in JavaScript?
in this scenario I am triggering events with jQuery on a canvas, but on specific elements in rendered this canvas, like drawn shapes or images.
mousemoveevent ---> [canvas] -> [find element] ---> mousemoveoverelementevent
Basically I catch the onmousemove event over the complete canvas with:
$('canvas').bind('mousemove'........
but the DOM does not exist within the canvas so I want it to transform (to chatch up later in the process) to:
$('canvas').bind('mousemoveOverElement'........
$('canvas').bind('mouseenterOnElement'........
$('canvas').bind('mouseleaveOnElement'........
and then assign something like
e.element = 'imageAtACertainPositionInTheCanvas'
I prefer to pass the modified event instead of assigning a new callback.