L
L
lavezzi12016-02-17 07:05:16
css
lavezzi1, 2016-02-17 07:05:16

Why does the animation only play once?

Hello. There is a panel that should go out on the right. I wrote the animation, but - it works only once, and the second and subsequent times it just appears without animation, here is the code:

animation-name: popup_from_right;
  animation-duration: 0.2s;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;


@keyframes popup_from_right {
    0%
    {
        opacity: 0;

        transform: translateX(100%);
    }

    100%
    {
        opacity: 1;

        transform: translateX(0);
    }
}

What is the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Rodionov, 2016-02-17
@Romashishka

css animation also has events. You need to remove the animation class from the element on click, and then assign it again.

F
frontender, 2016-02-17
@frontender

https://css-tricks.com/restart-css-animation/ please read.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question