S
S
sharoncarms2021-03-28 15:34:23
JavaScript
sharoncarms, 2021-03-28 15:34:23

How to write animation in js?

There is an animation css class:

.ltrSwipe {
      animation: ltrSwipe 0.5s ease;
      @keyframes ltrSwipe {
        0% {
          transform: translateX(-100%);
          opacity: 0;
        }
        100% {
          transform: translateX(0);
          opacity: 1;
        }
      }
    }

How can you do the same thing entirely with js or vue js without adding/removing a class?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2021-03-28
@firedragon

Heh, I'm not robbing you. Animation in styles is implemented natively, so your count in a Java script will slow down. Therefore, add classes, well, in the case of vue, use transition

D
Dmitry Barkowski, 2021-04-03
@TypeOFF

Try GSAP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question