I am using jQuery.eraser which works well to erase an image. But it works on click rather than hover. I thought I would be able to trigger a click on hover so it clicked where the mouse is. But what I have tried is not working. I am presuming I need to feed it some coordinates to work?
This is what I have tried:
$( "#image1" ).on('mouseenter mouseleave', function(){
$(this).trigger( "click" );
})
Here is a fiddle of a working example.
In the "bind events" section of eraser code, replace the bindings to the following:
$canvas.bind('mouseenter.eraser', methods.mouseDown);
$canvas.bind('mouseenter.eraser', methods.touchStart);
$canvas.bind('touchmove.eraser', methods.touchMove);
$canvas.bind('mouseleave.eraser', methods.touchEnd);
This seems to work on a laptop, however you should be aware that this is a quick and ugly fix, I am not sure how it will behave on mobile devices, and you should think twice before using it.