CSS3 animation-fill-mode 屬性
實(shí)例
為 h1 元素規(guī)定填充模式:
h1 { animation-fill-mode: forwards; }
瀏覽器支持
Internet Explorer 10、Firefox 以及 Opera 支持 animation-fill-mode 屬性。
Safari 和 Chrome 支持替代的 -webkit-animation-fill-mode 屬性。
注釋?zhuān)?/span>Internet Explorer 9 以及更早的版本不支持 animation-fill-mode 屬性。
定義和用法
animation-fill-mode 屬性規(guī)定動(dòng)畫(huà)在播放之前或之后,其動(dòng)畫(huà)效果是否可見(jiàn)。
注釋?zhuān)?/span>其屬性值是由逗號(hào)分隔的一個(gè)或多個(gè)填充模式關(guān)鍵詞。
默認(rèn)值: | none |
---|---|
繼承性: | no |
版本: | CSS3 |
JavaScript 語(yǔ)法: | object.style.animationFillMode=none |
語(yǔ)法
animation-fill-mode : none | forwards | backwards | both;
值 | 描述 |
---|---|
none | 不改變默認(rèn)行為。 |
forwards | 當(dāng)動(dòng)畫(huà)完成后,保持最后一個(gè)屬性值(在最后一個(gè)關(guān)鍵幀中定義)。 |
backwards | 在 animation-delay 所指定的一段時(shí)間內(nèi),在動(dòng)畫(huà)顯示之前,應(yīng)用開(kāi)始屬性值(在第一個(gè)關(guān)鍵幀中定義)。 |
both | 向前和向后填充模式都被應(yīng)用。 |
相關(guān)頁(yè)面
CSS3 教程:CSS3 動(dòng)畫(huà)