animationend event fires early. Why? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

animationend event fires early. Why?

When I try to add an event listener it fires immediately.

23rd Jan 2018, 3:36 PM
josh mizzi
josh mizzi - avatar
7 Answers
+ 1
have u tried setTimeout(eventlistener(event,func), x )
20th Mar 2018, 2:08 PM
Andrea Santona
Andrea Santona - avatar
+ 1
Then what did you expect? it means that the function fires as the document has loaded
20th Mar 2018, 2:20 PM
Andrea Santona
Andrea Santona - avatar
+ 1
oh there could be so many reasons.. just post the code
20th Mar 2018, 2:24 PM
Andrea Santona
Andrea Santona - avatar
+ 1
lol k xD
20th Mar 2018, 2:28 PM
Andrea Santona
Andrea Santona - avatar
0
I tried using document. onload.
20th Mar 2018, 2:15 PM
josh mizzi
josh mizzi - avatar
0
Yes but it is not waiting for the document to load. It is running before the document is loaded and then complaining that elements don't exist.
20th Mar 2018, 2:22 PM
josh mizzi
josh mizzi - avatar
0
Its fine I changed the idea to avoid the problem.
20th Mar 2018, 2:25 PM
josh mizzi
josh mizzi - avatar