zoukankan      html  css  js  c++  java
  • CSS3动画整理

    偷懒使用animate.css来制作效果

    animate动画的基本属性:

    属性描述CSS
    @keyframes 规定动画。 3
    animation 所有动画属性的简写属性,除了 animation-play-state 属性。 3
    animation-name 规定 @keyframes 动画的名称。 3
    animation-duration 规定动画完成一个周期所花费的秒或毫秒。默认是 0。 3
    animation-timing-function 规定动画的速度曲线。默认是 "ease"。 3
    animation-delay 规定动画何时开始。默认是 0。 3
    animation-iteration-count 规定动画被播放的次数。默认是 1。 3
    animation-direction 规定动画是否在下一周期逆向地播放。默认是 "normal"。 3
    animation-play-state 规定动画是否正在运行或暂停。默认是 "running"。 3
    animation-fill-mode 规定对象动画时间之外的状态。 3

    下面的两个例子设置了所有动画属性:

    div
    {
    animation: myfirst 5s linear 2s infinite alternate;
    /* Firefox: */
    -moz-animation: myfirst 5s linear 2s infinite alternate;
    /* Safari 和 Chrome: */
    -webkit-animation: myfirst 5s linear 2s infinite alternate;
    /* Opera: */
    -o-animation: myfirst 5s linear 2s infinite alternate;
    }

    @keyframes myfirst
    {
    0% {background:red; left:0px; top:0px;}
    25% {background:yellow; left:200px; top:0px;}
    50% {background:blue; left:200px; top:200px;}
    75% {background:green; left:0px; top:200px;}
    100% {background:red; left:0px; top:0px;}
    }

    @-moz-keyframes myfirst /* Firefox */
    {
    0% {background:red; left:0px; top:0px;}
    25% {background:yellow; left:200px; top:0px;}
    50% {background:blue; left:200px; top:200px;}
    75% {background:green; left:0px; top:200px;}
    100% {background:red; left:0px; top:0px;}
    }

    @-webkit-keyframes myfirst /* Safari and Chrome */
    {
    0% {background:red; left:0px; top:0px;}
    25% {background:yellow; left:200px; top:0px;}
    50% {background:blue; left:200px; top:200px;}
    75% {background:green; left:0px; top:200px;}
    100% {background:red; left:0px; top:0px;}
    }

    @-o-keyframes myfirst /* Opera */
    {
    0% {background:red; left:0px; top:0px;}
    25% {background:yellow; left:200px; top:0px;}
    50% {background:blue; left:200px; top:200px;}
    75% {background:green; left:0px; top:200px;}
    100% {background:red; left:0px; top:0px;}
    }

    animate

    #slide_one i:nth-child(1) {
        opacity: 0;
    }
    #slide_one.z-in i:nth-child(1) {
        opacity: 1;
        -webkit-backface-visibility: hidden;
        animation:bounceInRight 1s  both ;
        -webkit-animation: bounceInRight 1s  both ;
    }

    translate

    .chart div:nth-child(1) span{
    	display: block;
    	height: 0px;
    	background: #b94c02;
    	-webkit-transition: all .5s linear 2s;
    	transition: all .5s linear 2s;
    	-webkit-backface-visibility: hidden;
    }
    
    .z-current .chart div:nth-child(1) span{
    	height: 120px;
    }
    

      

    animation-fill-mode:none | forwards | backwards | both [ , none | forwards | backwards | both ]*

    none:默认值。不设置对象动画之外的状态

    forwards:设置对象状态为动画结束时的状态

    backwards:设置对象状态为动画开始时的状态

    both:设置对象状态为动画结束或开始的状态

    animation-fill-mode:both

    动画开始时为opacity:0;opacity:1;

    http://css.doyoe.com/

  • 相关阅读:
    Java基础(五):数组和Java方法
    Java基础(四):Java Number & Math 类、Character 类、String 类、StringBuffer & StringBuilder 类
    Java基础(三):修饰符、运算符、循环结构和分支结构
    Java基础(二):基本数据类型和变量类型
    Java基础(一):简介
    变量声明置顶规则、函数声明及函数表达式和函数的arguments属性初始化
    JS操作JSON常用方法
    站点的良好体验在网络优化中极为重要
    JVM基础(二) 实现自己的ClassLoader
    [DLX精确覆盖] hdu 3663 Power Stations
  • 原文地址:https://www.cnblogs.com/wallaceyuan/p/4179694.html
Copyright © 2011-2022 走看看