| 属性名 | animation-play-state |
|---|---|
| 値 | <single-animation-play-state> [, <single-animation-play-state> ]* |
| 値の詳細 | <single-animation-play-state> = running | paused |
| 初期値 | running |
| 適用可能要素 | すべての要素 (::before, ::after を含む) |
| 継承 | 継承しない |
| メディア | visual |
| アニメーション | 不可 |
| CSS | IE/Edge | Firefox | Chrome | Opera | Safari |
|---|---|---|---|---|---|
| CSS3 | 10 | 5(-moz) 16 | 4(-webkit) 43 | 15(-webkit) 30 | 4(-webkit) 9 |
アニメーションを実行、または一時停止の状態にします。このプロパティを参照することにより現在のアニメーションの状態を知ることができます。また、このプロパティに設定することにより、アニメーションを一時停止、開始することができます。アニメーションに関する概要は animation を参照してください。
| 値 | 説明 |
|---|---|
| running | アニメーションを実行中の状態にします。 |
| paused | アニメーションを一時停止の状態にします。 |
@keyframes myframe {
from {
color: #66f;
font-size: 20pt;
}
to {
color: #f66;
font-size: 24pt;
}
}
.test {
position: absolute;
animation-name: myframe;
animation-duration: 0.5s;
animation-timing-function: ease-in;
animation-delay: 0s;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-fill-mode: both;
animation-play-state: paused;
}
<div>
<input type="button" value="Start" onclick="document.getElementById('a1').style.animationPlayState='running'">
<input type="button" value="Stop" onclick="document.getElementById('a1').style.animationPlayState='paused'">
</div>
<div id="a1" class="test">A</div>