CSS3 animation-direction 屬性
實例
暫停動畫:
div
{
animation-direction:alternate;
-webkit-animation-direction:alternate; /* Safari 和 Chrome */
}
瀏覽器支持
Internet Explorer 10、Firefox 以及 Opera 支持 animation-direction 屬性。
Safari 和 Chrome 支持替代的 -webkit-animation-direction 屬性。
注釋:Internet Explorer 9 以及更早的版本不支持 animation-direction 屬性。
定義和用法
animation-direction 屬性定義是否應(yīng)該輪流反向播放動畫。
如果 animation-direction 值是 "alternate",則動畫會在奇數(shù)次數(shù)(1、3、5 等等)正常播放,而在偶數(shù)次數(shù)(2、4、6 等等)向后播放。
注釋:如果把動畫設(shè)置為只播放一次,則該屬性沒有效果。
默認值: | normal |
---|---|
繼承性: | no |
版本: | CSS3 |
JavaScript 語法: | object.style.animationDirection="alternate" |
語法
animation-direction: normal|alternate;
值 | 描述 | 測試 |
---|---|---|
normal | 默認值。動畫應(yīng)該正常播放。 | 測試 |
alternate | 動畫應(yīng)該輪流反向播放。 | 測試 |
相關(guān)頁面
CSS3 教程:CSS3 動畫