zoukankan      html  css  js  c++  java
  • css3中动画有哪些属性?

    通过css3,我们能够创建动画,这可以在许多网页中取代动画图片、Flash 动画以及 JavaScript。动画是使元素从一种样式逐渐变化为另一种样式的效果。那么在css中动画属性有哪些?

    vi设计http://www.maiqicn.com 办公资源网站大全https://www.wode007.com

    css3动画属性:

    • @keyframes:规定动画。

    • animation:所有动画属性的简写属性,除了 animation-play-state 属性。

    • animation-name:规定 @keyframes 动画的名称。

    • animation-duration:规定动画完成一个周期所花费的秒或毫秒。默认是 0。

    • animation-timing-function:规定动画的速度曲线。默认是 "ease"。

    • animation-delay:规定动画何时开始。默认是 0。

    • animation-iteration-count:规定动画被播放的次数。默认是 1。

    • animation-direction:规定动画是否在下一周期逆向地播放。默认是 "normal"。

    • animation-play-state:规定动画是否正在运行或暂停。默认是 "running"。

    • animation-fill-mode:规定对象动画时间之外的状态。

    实例:创建简单动画

    html代码:

    <div>
      <p>Falling Text</p>
    </div>

    CSS代码:

    @import url(http://fonts.googleapis.com/css?family=Gentium+Basic:400,700,400italic,700italic);
    body {
      background-color: #F5F5F5;
      color: #555;
      font-size: 1.1em;
      font-family: 'Gentium Basic', serif;
    }
    
    .container {
      margin: 50px auto;
      min- 320px;
      max- 500px;
    }
    
    .text {
      font-size: 3em;
      font-weight: bold;
      color: #0099cc;
      -webkit-transform-origin: left center;
      -ms-transform-origin: left center;
      transform-origin: left center;
      -webkit-animation: fall 4s infinite;
      animation: fall 4s infinite;
    }
    
    @-webkit-keyframes fall {
      from, 15% {
        -webkit-transform: rotate(0) translateX(0);
        transform: rotate(0) translateX(0);
        opacity: 1;
        -webkit-animation-timing-function: cubic-bezier(.07, 2.02, .67, .57);
        animation-timing-function: cubic-bezier(.07, 2.02, .67, .57);
      }
      50%,
      60% {
        -webkit-transform: rotate(90deg) translateX(0);
        transform: rotate(90deg) translateX(0);
        opacity: 1;
        -webkit-animation-timing-function: cubic-bezier(.13, .84, .82, 1);
        animation-timing-function: cubic-bezier(.13, .84, .82, 1);
      }
      85%,
      to {
        -webkit-transform: rotate(90deg) translateX(200px);
        transform: rotate(90deg) translateX(200px);
        opacity: 0;
      }
    }
    
    @keyframes fall {
      from, 15% {
        -webkit-transform: rotate(0) translateX(0);
        transform: rotate(0) translateX(0);
        opacity: 1;
        -webkit-animation-timing-function: cubic-bezier(.07, 2.02, .67, .57);
        animation-timing-function: cubic-bezier(.07, 2.02, .67, .57);
      }
      50%,
      60% {
        -webkit-transform: rotate(90deg) translateX(0);
        transform: rotate(90deg) translateX(0);
        opacity: 1;
        -webkit-animation-timing-function: cubic-bezier(.13, .84, .82, 1);
        animation-timing-function: cubic-bezier(.13, .84, .82, 1);
      }
      85%,
      to {
        -webkit-transform: rotate(90deg) translateX(200px);
        transform: rotate(90deg) translateX(200px);
        opacity: 0;
      }
    }
     
  • 相关阅读:
    nginx+vue+thinkphp5.1部署,解决前端刷新404,以及前端404解决后,后台又404的问题
    centos7.4挂载硬盘
    thinkphp5.1+layui2.x 时间戳转换为日期格式
    解决linux(ubuntu18)下无法挂载ntfs磁盘,并读写挂载硬盘
    sublime中nodejs配置
    jquery 中的$("obj").html('')中的html动态改变之后点击事件失效
    js怎么弹出变量的数据类型
    异步操作执行后子页面重新修改父页面iframe高度
    iframe标签父页面高度自适应
    string.Format()方法、Graphics类、DrawImage方法
  • 原文地址:https://www.cnblogs.com/xiaonian8/p/13735736.html
Copyright © 2011-2022 走看看