i want to make the ball move up and down once as this ball is the black in the eye so it will be like a facial emotion how can i | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

i want to make the ball move up and down once as this ball is the black in the eye so it will be like a facial emotion how can i

<div id='ball'></div> <script> var ball=document.getElementById('ball') var pos =50 function move(){ pos++ ball.style.top=pos+'px' if(pos<=110){ function back(){ clearInterval(t) pos-- ball.style.top=pos+'px' } var t=setInterval(move,10) } }

27th Sep 2020, 6:51 PM
Youssef Ashraf
Youssef Ashraf - avatar
1 Answer
+ 3
- You never call move() function. - There's is no call to back(), what is it supposed to do?? I think you meant "pos >= 110" - Please copy the whole code in CodePlayground and share the link here. Your code is incomplete and we need to look at the CSS too.
27th Sep 2020, 8:01 PM
Kevin ★