+ 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
4 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