资讯专栏INFORMATION COLUMN

transition-timing-function 属性

CatalpaFlat / 889人阅读

摘要:和和支持属性。注释以及更早版本的浏览器不支持属性。定义和用法属性规定过渡效果的速度曲线。在函数中定义自己的值。可能的值是至之间的数值。与上例相同,但通过来规定速度曲线

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 属性。

定义和用法:transition-timing-function 属性规定过渡效果的速度曲线。该属性允许过渡效果随着时间来改变其速度。

 


transition-timing-function: linear|ease|ease-in|ease-out|ease-in-out|cubic-
bezier(n,n,n,n);

cubic-bezier(n,n,n,n) 在 cubic-bezier 函数中定义自己的值。可能的值是 0 至 1 之间的数值。
#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 来规定速度曲线:

#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);}

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/799.html

相关文章

  • transition-timing-function 属性

    摘要:支持替代的属性。注释以及更早版本的浏览器不支持属性。定义和用法属性规定过渡效果的速度曲线。默认值继承性版本语法语法值描述规定以相同速度开始至结束的过渡效果等于。可能的值是至之间的数值。以相同的速度从开始到结束的过渡效果: div { transition-timing-function: linear; -moz-transition-timing-function: linear; /*...

    jasperyang 评论0 收藏0
  • css3过渡

    摘要:即该两个状态变化的过渡曲线一个过渡函数其取值是一个三次方的贝塞尔曲线的值。分别有四个点,对应于三次方的贝塞尔曲线。规定过渡效果开始作用之前需要等待的时间。如下过渡总写 css过渡css过渡为一种状态到另外一种状态的变换 transition 过渡 transition 为一个简写属性,是一个transition-property (定义过渡的属性的名称)以及 transition-du...

    Soarkey 评论0 收藏0
  • CSS3——过渡(transition)

    摘要:表示任何属性都不应用过渡,并且可以终止正在执行的过渡。提供两种计算曲线阶梯函数三次贝兹曲线。在插入元素如或改变属性后立即使用过渡元素将视为没有开始状态,始终处于结束状态。过渡取消不会触发该事件。 一、概述 CSS属性的值从一个值变成另一个值的过程叫做渐变,重点突出变化的过程。CSS3 transition系列属性可控制这个变化过程,使得属性值变化过程更加平滑。一个过渡应包含这几个属性:...

    leejan97 评论0 收藏0
  • 翻译 | 深入理解CSS时序函数

    摘要:一条正在绘制中的三次方贝塞尔曲线因为该曲线由四个点形成,我们将其称为三次方贝塞尔曲线,而不是二次方曲线三个点或四次方曲线五个点。现在终于可以将贝塞尔曲线收入囊中了,也已经对这 作者:Nicolas(沪江前端开发工程师)本文原创翻译,转载请注明作者及出处。 各位,赶紧绑住自己并紧紧抓牢了,因为当你掌握了特别有趣但又复杂的CSS时序函数之后,你将会真正体验到竖起头发般的兴奋感受。 好吧,本...

    Little_XM 评论0 收藏0

发表评论

0条评论

CatalpaFlat

|高级讲师

TA的文章

阅读更多
最新活动
阅读需要支付1元查看
<