Maintaining the final state at end of a CSS3 animation

前端 未结 4 1814
天涯浪人
天涯浪人 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:45

    If you are using more animation attributes the shorthand is:

    animation: bubble 2s linear 0.5s 1 normal forwards;
    

    This gives:

    • 2s duration
    • linear timing-function
    • 0.5s delay
    • 1 iteration-count (can be 'infinite')
    • normal direction
    • forwards fill-mode (set 'backwards' if you want to have compatibility to use the end position as the final state[this is to support browsers that has animations turned off]{and to answer only the title, and not your specific case})

提交回复
热议问题