HTML DOM Style animationDirection 屬性

2018-08-04 20:40 更新

Style animationDirection 屬性

Style 對(duì)象參考手冊(cè) Style 對(duì)象

實(shí)例

改變 <div> 元素的 animationDirection 屬性:

document.getElementById("myDIV").style.animationDirection="reverse";

嘗試一下 ?

定義和用法

animationDirection 屬性設(shè)置或返回是否循環(huán)交替反向播放動(dòng)畫(huà)。

注意:如果動(dòng)畫(huà)被設(shè)置為只播放一次,該屬性將不起作用。


瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

只有 Firefox 支持 animationDirection 屬性。


語(yǔ)法

返回 animationDirection 屬性:

object.style.animationDirection

設(shè)置 animationDirection 屬性:

object.style.animationDirection="normal|reverse|alternate|alternate-reverse|initial|inherit"

屬性值

描述
normal 默認(rèn)值。動(dòng)畫(huà)按正常播放。
reverse 動(dòng)畫(huà)反向播放。
alternate 動(dòng)畫(huà)在奇數(shù)次(1、3、5...)正向播放,在偶數(shù)次(2、4、6...)反向播放。
alternate-reverse 動(dòng)畫(huà)在奇數(shù)次(1、3、5...)反向播放,在偶數(shù)次(2、4、6...)正向播放。
initial 設(shè)置該屬性為它的默認(rèn)值。請(qǐng)參閱 initial。
inherit 從父元素繼承該屬性。請(qǐng)參閱 inherit。

技術(shù)細(xì)節(jié)

默認(rèn)值: normal
返回值: 字符串,表示元素的 animation-direction 屬性。
CSS 版本 CSS3


相關(guān)文章

CSS 參考手冊(cè):animation-direction 屬性


Style 對(duì)象參考手冊(cè) Style 對(duì)象

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)