Can I change typeevents in JavaScript?
in this scenario, I fire events with jQuery on the canvas, but on certain elements in the rendering of this canvas, for example, drawn shapes or images.
mousemoveevent ---> [canvas] -> [find element] ---> mousemoveoverelementevent
Basically I will catch the onmousemove event on a full canvas with:
$('canvas').bind('mousemove'........
but the DOM does not exist inside the canvas, so I want it to be converted (for later addition in the process):
$('canvas').bind('mousemoveOverElement'........
$('canvas').bind('mouseenterOnElement'........
$('canvas').bind('mouseleaveOnElement'........
and then assign something like
e.element = 'imageAtACertainPositionInTheCanvas'
I prefer to send a modified event instead of assigning a new callback.
source
share