Maintaining the final state at end of a CSS3 animation

前端 未结 4 1807
天涯浪人
天涯浪人 2020-11-22 07:24

I\'m running an animation on some elements that are set to opacity: 0; in the CSS. The animation class is applied onClick, and, using keyframes, it changes the

4条回答
  •  没有蜡笔的小新
    2020-11-22 07:54

    IF NOT USING THE SHORT HAND VERSION: Make sure the animation-fill-mode: forwards is AFTER the animation declaration or it will not work...

    animation-fill-mode: forwards;
    animation-name: appear;
    animation-duration: 1s;
    animation-delay: 1s;
    

    vs

    animation-name: appear;
    animation-duration: 1s;
    animation-fill-mode: forwards;
    animation-delay: 1s;
    

提交回复
热议问题