Is there a way to pause CSS transition mid-way?

前端 未结 1 1465
梦如初夏
梦如初夏 2021-01-02 04:32

Actually the subject is pretty explanatory. But to clarify, I am curious of several things:

  1. Is there a way - not to disable - but to pause the property tran

相关标签:
1条回答
  • 2021-01-02 04:48

    1) You can use the animation-play-state CSS attribute, and toggle between

    animation-play-state:running, and animation-play-state:paused https://developer.mozilla.org/en-US/docs/Web/CSS/animation-play-state

    2) The short answer is yes. Whichever property you read halfway through your transition (lets say height), will return the current value at the moment queried.

    0 讨论(0)
提交回复
热议问题