W
W
Worddoc2017-03-01 17:48:31
css
Worddoc, 2017-03-01 17:48:31

How to let keyframes finish the animation after the event is removed?

Hello. There is an animation of waves coming from the block. The animation fires on hover, but when the hover disappears, the animation stops very abruptly and returns to its original state. How can I let the animation smoothly finish playing the animation after "hate"? Thank you.
codepen.io/anon/pen/jBWrYR

<div class="info__block info__block-1">
</div>

.info__block {
        width: 100px;
        height: 100px;
        background: aqua;
        border-radius: 50px;
        position: relative;
        display: flex;
        justify-content: center;
}

.info__block:before {
       content: '';
       position: absolute;
       width: 100%;
       height: 100%;
       border-radius: 50px;
       border-top: 2px solid aqua;
}

.info__block:hover:before {
       animation: link-line 2.5s infinite .5s linear;
}

@keyframes link-line {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  60% {
    opacity: 0;
  }
  100% {
    transform: translateY(-50%) scale(1.6);
    opacity: 0;
  }
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
Worddoc, 2017-03-01
@Worddoc

Found the problem. The property animation-iteration-count: infinite does not have an animationend event. Will have to do without it.

A
Artyom, 2017-03-01
@SlampD

stackoverflow.com/questions/16765727/css3-animatio...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question