D
D
DeniSidorenko2019-05-23 07:45:31
css
DeniSidorenko, 2019-05-23 07:45:31

How to set keyframes animation on slide change?

Hello, there is such css code Stylys

.slider-item
  .slider-item__left
    transform: translate3d(50px,0,0)
    transition all .5s ease
    opacity 0
    transition-delay: 0.3s
    

  &.slick-current
    .slider-item__left
      transform: translateX(0)
      opacity 1
    .slider-item__right
      animation-name: bounce; 
      animation-duration: .5s; 
      animation-fill-mode: both;
      
@keyframes bounce  
  0%
    opacity 0
    transform: translateX(70px)
  50%
    opacity 0.5
    transform: translateX(-30px)
  100%
    opacity 1
    transform: translateX(0)

Slider Item Left which just moves works great. The slide changes, it is given the class s lick current and .slider-item__left animates each time. But for slider-item__right where the animation from Keyframes is going on, it works only Once . When loading the page. How can I make this animation run similarly to the left side

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DeniSidorenko, 2019-05-23
@DeniSidorenko

Everything worked fine) it was just too much, it was necessary to add animation-delay)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question