Answer the question
In order to leave comments, you need to log in
How to delegate the mouse down event?
Hello dear developers.
I implemented this thing https://jsfiddle.net/lokdmt/cjj6b5x7/8/ , where you can erase dirt from a T-shirt and after a certain percentage of erased stains a popup appears (now it's just an alert), but that's not the point.
The task is as follows: the client grabs a sponge with the mouse and erases the stains.
At the moment, the spots are erased separately with the mouse cursor, and you can grab the sponge separately. But with a captured sponge, the stains are not erased.
I suspect that it is possible to delegate the event of the pressed mouse to the sponge, but it does not work.
I would be very grateful for help or advice on how to implement this better.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question