zoukankan      html  css  js  c++  java
  • -webkit-animation的使用

    -webkit-animation:仍旧是一个复合属性,

    -webkit-animation: name duration timing-function delay iteration_count direction;

    包括以下几个属性

    (1)  -webkit-animation-name    这个属性的使用必须结合@-webkit-keyframes一起使用

    eg:  @-webkit-keyframes fontchange{

    0%{font-size:10px;}

    30%{font-size:15px;}

    100%{font-siez:12px;}

    }

    百分比的意思就是duration的百分比,如果没有设置duration的话,则表示为无穷大

    div{ -webkit-animation-name:fontchange;}

    (2)-webkit-animation-duration   表示动画持续的时间

    (3)-webkit-animation-timing-function  表示动画使用的时间曲线

    【语法】: -webkit-animation-timing-function: ease | linear | ease-in | ease-out | ease-in-out

    (4)-webkit-animation-delay    表示开始动画之前的延时

    【语法】 -webkit-animation-delay: delay_time;

    (5)-webkit-animation-iteration-count  表示动画要重复几次

    【语法】-webkit-animation-iteration-count: times_number;

    (6) -webkit-animation-direction   表示动画的方向

    【语法】-webkit-animation-direction: normal(默认)  | alternate

    normal  方向始终向前

    alternate 当重复次数为偶数时方向向前,奇数时方向相反

    【另外】跟animation有关的其他属性

    (1)-webkit-animation-fill-mode : none (默认)| backwards | forwards | both  设置动画开始之前和结束之后的行为(测试结

    果不是很清晰)

    (2)-webkit-animation-play-state: running(默认) | paused  设置动画的运行状态

    综合案例:

    @-webkit-keyframes fontbulger {
    0% {
    font-size: 10px;
    }
    30% {
    font-size: 15px;
    }
    100% {
    font-size: 12px;
    }
    }

    #box {
    -webkit-animation-name:  fontbulger;
    -webkit-animation-duration: 1s;
    -webkit-animation-iteration-count:3;
    -webkit-animation-direction: alternate;
    -webkit-animation-timing-function: ease-out;
    -webkit-animation-fill-mode: both;
    -webkit-animation-delay: 2s;
    }

    <div id=”box”>文字变化</div>

  • 相关阅读:
    XmlNode中Value和InnerText的区别
    C# 后台POST和GET 获取数据
    XDocument简单入门
    一个基于jQuery的简单树形菜单
    使用C#的HttpWebRequest模拟登陆网站
    JS中offsetTop、clientTop、scrollTop、offsetTop各属性介绍
    height、clientHeight、scrollHeight、offsetHeight区别
    使用httpwebrequest Post数据到网站
    sql语句中left join、inner join中的on与where的区别
    SQL Join的一些总结
  • 原文地址:https://www.cnblogs.com/mrxia/p/3582329.html
Copyright © 2011-2022 走看看