Why does ease-in and ease-out not work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why does ease-in and ease-out not work?

Go on javascript https://code.sololearn.com/W8n1MG3ea9QR/?ref=app

26th Jun 2022, 11:42 AM
Lego in Motion
Lego in Motion - avatar
7 Answers
+ 4
The transition statement is "easy-out" not "eas-out" and "easy-in" not ="eas-in".
26th Jun 2022, 12:09 PM
JaScript
JaScript - avatar
+ 1
window.onload=()=>{ var bottom=40.5; function jump() { bottom=60; // HERE document.getElementById("player").style.transitionTimingFunction="easy-out"; document.getElementById("player").style.bottom=bottom+"%"; setTimeout(back, 700) } function back() { bottom=40.5; // AND HERE document.getElementById("player").style.transitionTimingFunction="easy-in"; document.getElementById("player").style.bottom=bottom+"%"; } jump() }
26th Jun 2022, 11:57 AM
JaScript
JaScript - avatar
+ 1
This is the corrected code and works.
26th Jun 2022, 12:02 PM
JaScript
JaScript - avatar
+ 1
Just replace your code with my.
26th Jun 2022, 12:07 PM
JaScript
JaScript - avatar
0
Why did you just copy my code?
26th Jun 2022, 11:59 AM
Lego in Motion
Lego in Motion - avatar
0
Not for me then. Maybe on phones it doesn't?
26th Jun 2022, 12:03 PM
Lego in Motion
Lego in Motion - avatar
0
Oh yes! Thanks!
26th Jun 2022, 12:30 PM
Lego in Motion
Lego in Motion - avatar