> For the complete documentation index, see [llms.txt](https://docs.webmix.cc/css-animation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.webmix.cc/css-animation/dong-hua-xiao-guo-animation/5.8-animation-play-state.md).

# 5.8 播放狀態 animation-play-state

## animation-play-state 說明

動畫效果在執行的時候，狀態是 running，然而我們可以透過 `animation-play-state` 來設定暫停與播放的切換。

常見設定的值：

* **`running`**：這是預設值。
* **`paused`**：暫停。

## 範例

一個無限左右滑動的 div 區塊，若點擊的話，會暫停，再點擊的話，會恢復動畫的執行，JS 只是單純的切換 class：

{% embed url="<https://codepen.io/carlos411/pen/LYEbPrO>" %}
