In JavaScript how do you move the animation up and down | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

In JavaScript how do you move the animation up and down

var t = setInterval(move, 10); var position = 0; var box = document.getElementById("box") function move( ) { if(position >= 300) { var x = setInterval(go, 10) function go(){ position -+= 1 box.style.right = position + "px" }

26th Jun 2021, 1:36 PM
Predator
Predator - avatar
3 Answers
26th Jun 2021, 2:34 PM
Calviղ
Calviղ - avatar
+ 1
https://code.sololearn.com/Wys9sCI87AvL/?ref=app
28th Jun 2021, 3:33 AM
Calviղ
Calviղ - avatar
0
Predator Use css top property to move a box up and down. https://code.sololearn.com/Wdrep3M5X2cW/?ref=app
26th Jun 2021, 2:34 PM
˜”*°•.˜”*°• Mohan 333 •°*”˜.•°*”˜
˜”*°•.˜”*°• Mohan 333 •°*”˜.•°*”˜ - avatar