Answer the question
In order to leave comments, you need to log in
How to use functions like ease in out in pure js?
There is progress, which changes from 0 to 1, depending on this, the width of the element changes.
I want to make an animation using ease in out.
Now like this:
// 250 final width
let width = Math.round(e.progress.toFixed(2) * 250);
Answer the question
In order to leave comments, you need to log in
Use the link that was given to you in the comments https://learn.javascript.ru/js-animation
Or, just specify this animation through css.
and through js you change the value of the width or other properties. In my opinion, this is much easier than bothering and writing them in js.
transition: .2s ease-in-out;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question