美文网首页
CSS动画效果

CSS动画效果

作者: april_Dong | 来源:发表于2016-08-01 12:34 被阅读0次

transition-property

transition-property:none|<single-transition-property>[','<single-transition-property>]*
<single-transition-property>=all|<IDENT>
transition-property:none;默认没有过渡效果
transition-property:all;所有属性都有过渡效果
transition-property:left;
transition-property:left,color;

transition-duration 过渡效果执行时间

transition-duration:<time>[,<time>]*
transition-duration:0s;
transition-duration:1s;
transition-duration:1s,2s,3s;

transition-timing-function

transition-timing-function:<single-transition-timing-function>[','<single-transition-timing-function>]*
<single-tansition-timing-function>=ease|linear|ease-in|ease-out|ease-in-out|cubic-bezier(<number>,<number>,<number>,<number>)|
step-start|step-end|
steps(<integer>[,[start|end]]?)
ease两头慢中间快
linear线性 匀速
ease-in开始慢
ease-out结束慢
transition-timing-function:ease;
transition-timing-function:cubic-bezier(0.25,0.1,0.25,1);
transition-timing-function:linear;
transition-timing-function:cubic-bezier(0,0,1,1);
transition-timing-function:ease,linear;

transition-delay 动画延时

transition-delay:<time>[,<time>]*
transition-delay:1s;

transition

transition:<single-transition>[','<single-transition>]*
<single-transition>=[none|<single-transition-property>]||
<time>||<single-transition-timing-function>||<time>
transition:2s;duration

transition与animation的区别:
1.transition需要触发,animation自动触发的
2.animation可以做多帧动画

关键帧

animation-name

animation-name:<single-animation-name>[',' <single-animation-name>]*
<single-animation-name> = none| <IDENT>

animation-duration

animation-duration:<time>[,<time>]*
animation-duration:0s;
animation-duration:1s;

animation-timing-function

animation-timing-function:<single-timing-function>[',' ,<single-timing-function>]*
<single-timing-function> = <single-transition-timing-function>

animation-iteration-count 执行次数

animation-iteration-count:<single-animation-iteration-count>[',' <single-animation-iteration-count>]*
<single-animation-iteration-count> = infinite|<number>

animation-direction动画执行方向

animation-direction:<single-animation-direction>[',' <single-animtion-direction>]*
<single-animation-direction> =normal|reverse|alternate|alternate-reverse
alternate往返动画

animation-play-state

animation-play-state:<single-animation-play-state>[',' <single-animation-play-state>]*
<single-animation-play-state> = running|paused

animation-delay

animation-delay:<time>[,<time>]*

animation-fill-mode

动画在开始的时候是否要保持第一帧的状态,动画在结束的时候是否要保持最后一帧的状态
animation-fill-mode:<single-animation-fill-mode>[',' <single-animation-fill-mode>]*
<single-animation-fill-mode> = none|backwards|forwards|both
animation-fill-mode:backwards;开始的时候保持第一帧的状态
animation-fill-mode:forwards,backwards;
animation-fill-mode:both;开始保持第一帧状体,结束保持最后一帧状态;

animation

animation:<single-animation>[','<single-animation>]*
<single-animation> = <single-animation-name>||<time>||<single-animation-timing-function>||<time>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>

关键帧定义
@keyframes
@keyframes abc{
from{opacity:1;height:100px; }
to{ opacity:0.5;height:200px; }
}
@keyframes abc{
0%{opacity:1;height:100px;}
100%{opacity:0.5;height:200px;}
}
@keyframes flash{
0%,50%,100%{opacity:1;}
25%,75%{opacity:0;}
}
animation:flash 0.5s both;

相关文章

  • CSS3中的过渡动画以及添加动画规则

    之前的网页实现动画效果必须依赖Flash或js,CSS3动画效果属性主要分为三类:过渡、变换、动画。但是这些CSS...

  • 05.React高级部分(下)

    React中实现CSS过渡动画 React中使用CSS动画效果 修改style.css文件 使用react-tra...

  • AngularJS 动画+依赖注入+路由+应用

    AngularJS 动画 AngularJS 提供了动画效果,可以配合 CSS 使用。AngularJS 使用动画...

  • js动画

    css动画: css动画的优点: 代码量少:通过简单的属性配置,就可以实现各种动画效果; 执行效率高:因为css代...

  • CSS 动画效果

    transition 过渡属性,transition是一个简写属性,用于设置四个过渡属性 transtion- p...

  • css 动画效果

    .loadingImg{display: block;height: 600px;position:relativ...

  • CSS动画效果

    css动画样式链接:https://www.jianshu.com/p/9cae70cec921;css卡片旋转链...

  • CSS动画效果

    transition-property transition-property:none| [',' ]* =al...

  • CSS动画效果

    动画(animation) 什么是动画动画是 CSS3 中最具颠覆性的特征之一,可通过设置多个节点来精确的控制一个...

  • css动画效果

    transition 简介 transition: property duration timing-functi...

网友评论

      本文标题:CSS动画效果

      本文链接:https://www.haomeiwen.com/subject/hhsbjttx.html