How to make the buttons on my code functuon properly? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to make the buttons on my code functuon properly?

Hey all. I've made a animation that makes a box make it's way around a container. I added 2 buttons, "start" and "stop". Once the "start" button is pressed the box starts moving in an endless loop around the container. Problem is, once I press the "stop" button, the box goes back to it's starting position, but when I press "start" the box only goes back and forth with no up and down movement. Any help would be very much appreciated :) https://code.sololearn.com/WbEjZD6iNOhd/?ref=app

29th May 2019, 12:29 PM
Yoni Gelband
Yoni Gelband - avatar
1 Answer
0
// box.style.left = '0px'; // box.style.top = '0px'; // box.style.right = '50px'; // box.style.bottom = '50px'; // posR = 0; // posL = 150; // posU = 0; // posD = 150; Is this?! https://code.sololearn.com/WMTVWafAqA7P/#js
29th May 2019, 1:09 PM
Jônatas Araripe
Jônatas Araripe - avatar