摘要:支持替代的屬性。注釋以及更早版本的瀏覽器不支持屬性。定義和用法屬性規(guī)定過渡效果的速度曲線。默認(rèn)值繼承性版本語法語法值描述規(guī)定以相同速度開始至結(jié)束的過渡效果等于。可能的值是至之間的數(shù)值。
以相同的速度從開始到結(jié)束的過渡效果:
div { transition-timing-function: linear; -moz-transition-timing-function: linear; /* Firefox 4 */ -webkit-transition-timing-function: linear; /* Safari 和 Chrome */ -o-transition-timing-function: linear; /* Opera */ }
Internet Explorer 10、Firefox、Opera 和 Chrome 支持 transition-timing-function 屬性。
Safari 支持替代的 -webkit-transition-timing-function 屬性。
注釋:Internet Explorer 9 以及更早版本的瀏覽器不支持 transition-timing-function 屬性。
?
默認(rèn)值: | ease |
---|---|
繼承性: | no |
版本: | CSS3 |
JavaScript 語法: | object.style.transitionTimingFunction="linear" |
transition-timing-function: linear|ease|ease-in|ease-out|ease-in-out|cubic-
bezier(n,n,n,n);
值 | 描述 |
---|---|
linear | 規(guī)定以相同速度開始至結(jié)束的過渡效果(等于 cubic-bezier(0,0,1,1))。 |
ease | 規(guī)定慢速開始,然后變快,然后慢速結(jié)束的過渡效果(cubic-bezier(0.25,0.1,0.25,1))。 |
ease-in | 規(guī)定以慢速開始的過渡效果(等于 cubic-bezier(0.42,0,1,1))。 |
ease-out | 規(guī)定以慢速結(jié)束的過渡效果(等于 cubic-bezier(0,0,0.58,1))。 |
ease-in-out | 規(guī)定以慢速開始和結(jié)束的過渡效果(等于 cubic-bezier(0.42,0,0.58,1))。 |
cubic-bezier(n,n,n,n) | 在 cubic-bezier 函數(shù)中定義自己的值。可能的值是 0 至 1 之間的數(shù)值。 |
提示:請(qǐng)?jiān)趯?shí)例中測(cè)試不同的值,這樣可以更好地理解它們的工作原理。
為了更好地理解不同的函數(shù)值,請(qǐng)看下面帶有五個(gè)不同值的五個(gè)不同的 div 元素:
#div1 {transition-timing-function: linear;} #div2 {transition-timing-function: ease;} #div3 {transition-timing-function: ease-in;} #div4 {transition-timing-function: ease-out;} #div5 {transition-timing-function: ease-in-out;} /* Firefox 4: */ #div1 {-moz-transition-timing-function: linear;} #div2 {-moz-transition-timing-function: ease;} #div3 {-moz-transition-timing-function: ease-in;} #div4 {-moz-transition-timing-function: ease-out;} #div5 {-moz-transition-timing-function: ease-in-out;} /* Safari and Chrome: */ #div1 {-webkit-transition-timing-function: linear;} #div2 {-webkit-transition-timing-function: ease;} #div3 {-webkit-transition-timing-function: ease-in;} #div4 {-webkit-transition-timing-function: ease-out;} #div5 {-webkit-transition-timing-function: ease-in-out;} /* Opera: */ #div1 {-o-transition-timing-function: linear;} #div2 {-o-transition-timing-function: ease;} #div3 {-o-transition-timing-function: ease-in;} #div4 {-o-transition-timing-function: ease-out;} #div5 {-o-transition-timing-function: ease-in-out;}
與上例相同,但通過 cubic-bezier 來規(guī)定速度曲線:
#div1 {transition-timing-function: cubic-bezier(0,0,1,1;} #div2 {transition-timing-function: cubic-bezier(0.25,0.1,0.25,1);} #div3 {transition-timing-function: cubic-bezier(0.42,0,1,1);} #div4 {transition-timing-function: cubic-bezier(0,0,0.58,1);} #div5 {transition-timing-function: cubic-bezier(0.42,0,0.58,1);} /* Firefox 4: */ #div1 {-moz-transition-timing-function: cubic-bezier(0,0,0.25,1);} #div2 {-moz-transition-timing-function: cubic-bezier(0.25,0.1,0.25,1);} #div3 {-moz-transition-timing-function: cubic-bezier(0.42,0,1,1);} #div4 {-moz-transition-timing-function: cubic-bezier(0,0,0.58,1);} #div5 {-moz-transition-timing-function: cubic-bezier(0.42,0,0.58,1);} /* Safari and Chrome: */ #div1 {-webkit-transition-timing-function: cubic-bezier(0,0,1,1;} #div2 {-webkit-transition-timing-function: cubic-bezier(0.25,0.1,0.25,1);} #div3 {-webkit-transition-timing-function: cubic-bezier(0.42,0,1,1);} #div4 {-webkit-transition-timing-function: cubic-bezier(0,0,0.58,1);} #div5 {-webkit-transition-timing-function: cubic-bezier(0.42,0,0.58,1);} /* Opera: */ #div1 {-o-transition-timing-function: cubic-bezier(0,0,1,1;} #div2 {-o-transition-timing-function: cubic-bezier(0.25,0.1,0.25,1);} #div3 {-o-transition-timing-function: cubic-bezier(0.42,0,1,1);} #div4 {-o-transition-timing-function: cubic-bezier(0,0,0.58,1);} #div5 {-o-transition-timing-function: cubic-bezier(0.42,0,0.58,1);}
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://m.specialneedsforspecialkids.com/yun/995.html
摘要:和和支持屬性。注釋以及更早版本的瀏覽器不支持屬性。定義和用法屬性規(guī)定過渡效果的速度曲線。在函數(shù)中定義自己的值。可能的值是至之間的數(shù)值。與上例相同,但通過來規(guī)定速度曲線transition-timing-function: linear; -moz-transition-timing-function: linear; /* Firefox 4 */ -webkit-transition-...
摘要:即該兩個(gè)狀態(tài)變化的過渡曲線一個(gè)過渡函數(shù)其取值是一個(gè)三次方的貝塞爾曲線的值。分別有四個(gè)點(diǎn),對(duì)應(yīng)于三次方的貝塞爾曲線。規(guī)定過渡效果開始作用之前需要等待的時(shí)間。如下過渡總寫 css過渡css過渡為一種狀態(tài)到另外一種狀態(tài)的變換 transition 過渡 transition 為一個(gè)簡(jiǎn)寫屬性,是一個(gè)transition-property (定義過渡的屬性的名稱)以及 transition-du...
摘要:表示任何屬性都不應(yīng)用過渡,并且可以終止正在執(zhí)行的過渡。提供兩種計(jì)算曲線階梯函數(shù)三次貝茲曲線。在插入元素如或改變屬性后立即使用過渡元素將視為沒有開始狀態(tài),始終處于結(jié)束狀態(tài)。過渡取消不會(huì)觸發(fā)該事件。 一、概述 CSS屬性的值從一個(gè)值變成另一個(gè)值的過程叫做漸變,重點(diǎn)突出變化的過程。CSS3 transition系列屬性可控制這個(gè)變化過程,使得屬性值變化過程更加平滑。一個(gè)過渡應(yīng)包含這幾個(gè)屬性:...
摘要:一條正在繪制中的三次方貝塞爾曲線因?yàn)樵撉€由四個(gè)點(diǎn)形成,我們將其稱為三次方貝塞爾曲線,而不是二次方曲線三個(gè)點(diǎn)或四次方曲線五個(gè)點(diǎn)。現(xiàn)在終于可以將貝塞爾曲線收入囊中了,也已經(jīng)對(duì)這 作者:Nicolas(滬江前端開發(fā)工程師)本文原創(chuàng)翻譯,轉(zhuǎn)載請(qǐng)注明作者及出處。 各位,趕緊綁住自己并緊緊抓牢了,因?yàn)楫?dāng)你掌握了特別有趣但又復(fù)雜的CSS時(shí)序函數(shù)之后,你將會(huì)真正體驗(yàn)到豎起頭發(fā)般的興奮感受。 好吧,本...
閱讀 1975·2023-04-25 15:45
閱讀 1214·2021-09-29 09:34
閱讀 2504·2021-09-03 10:30
閱讀 2009·2019-08-30 15:56
閱讀 1466·2019-08-29 15:31
閱讀 1273·2019-08-29 15:29
閱讀 3204·2019-08-29 11:24
閱讀 3061·2019-08-26 13:45