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/

  • 相关阅读:
    jqGrid 属性、事件全集
    把app(apk和ipa文件)安装包放在服务器上供用户下方法
    c#中如何获取本机MAC地址、IP地址、硬盘ID、CPU序列号等系统信息
    Visual Studio Installer打包安装项目VS2015
    小白入门服务器压测
    PHP正则表达式快速查找
    PHP创建创建资源流上下文实现携带cookie访问
    js中文转Unicode编码与解码
    PHP的fpm配置学习笔记
    微信公众号PHP生成二维码海报的几个小扩展
  • 原文地址:https://www.cnblogs.com/wallaceyuan/p/4179694.html
Copyright © 2011-2022 走看看