+ 43
How to run one JavaScript animation after another?
I created 2 JavaScript animation functions, and they run simultaniously. How can i make the second function run after the first one? https://code.sololearn.com/Wv7XGJ9f14jL/?ref=app
4 ответов
+ 12
You can call the second function after the first one finished like this:
if (pos1 >= 200) {
clearInterval(t1);
t2 = setInterval(move2, 3);
}
+ 37
Airree It worked, thank you very much 😊
+ 10
You can use promises as well
uncomment lines 182-193 and comment line 180
https://code.sololearn.com/WM0pzE0DictQ/?ref=app
0
animation query in jquery can help