+1 vote
by
You need to trigger the canvas animation on the click of the button, and when you click again, the animation should reset and repeat (tugle effect). In the example I did so, but my click function is called many times without clearing the old canvas, which itself affects the speed (fps) animation. How to do it right?
https://jsfiddle.net/ubxpf9aj/

1 Answer

0 votes
by
 
Best answer
snippet
...