Skip to content
Advertisement

Repeating function calls

When i change a frame size, like 3×3, 4×4, 5×5 etc. canvas draw n number of times constantly calculation in progression. I can’t figure out where the error might be. Can you help me fix this bug. I suspect that the problem is in the function call in the class, or in one of the functions.

Code snippet and screenshot picture i attached

Code bug

JavaScript
JavaScript
JavaScript

Advertisement

Answer

Because you don’t deleting the event from frame__list.

Error

You can delete event by using EventTarget.removeEventListener()

Or

By replacing node box.replaceWith(box.cloneNode(true));

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement