动画

作者: 洛洛kkkkkk | 来源:发表于2017-04-18 19:21 被阅读0次
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>动画</title>
        <style type="text/css">
        /*给一个元素添加动画只需要两步
         1、通过@keyframes自定义一个动画,keyframes跟着的是动画的名称。动画的内容就是from到to的变化
         2、在这个元素的里面设置animation-name和animation-duration
            animation-name 动画名称
            animation-duration 动画时长*/
            @keyframes run{
                0{
                    transform: translateX(0px);
                }
                50%{
                    transform: translateX(800px);
                }
                100%{
                    transform: translateX(100px);
                }
            }
            .redDiv{
                width: 200px;
                height: 200px;
                background-color: red;
                font-size: 25px;
                color: white;
                /*必须属性*/
                /*动画名称*/
                animation-name: run;
                /*动画时长*/
                animation-duration: 1s;
                
                /*可选属性*/
                /*动画延时几秒开始*/
                animation-delay: 0s;
                /*动画运动的速度曲线*/
                animation-timing-function: linear;
                /*动画执行的次数
                 infinite 无限次*/
                animation-iteration-count: 5;
                /*动画结束之后停留在什么位置*/
                animation-fill-mode: forwards;
                /*动画执行的方向
                 anternate 动画执行的时候1、3、5是正常方向,
                 2、4、6是反向动画*/
                animation-direction: alternate;
                /*动画播放的状态,paused 代表暂停*/
                animation-play-state: paused;
            }
        </style>
    </head>
    <body>
        <div class="redDiv">打野来抓啊</div>
    </body>
</html>

相关文章

  • Android回顾--(十六) 动画简析

    动画: 补间动画(Tween动画) 帧动画(Frame动画) 属性动画(Property动画) 补间动画 特点: ...

  • 在山西太原,做个二维动画需要哪些制作流程?

    二维动画有哪些类型? flash动画,课件动画,mg动画,ae动画,GIF动画,手绘动画,网页动画,企业动画,宣传...

  • Android 动画

    【Android 动画】 动画分类补间动画(Tween动画)帧动画(Frame 动画)属性动画(Property ...

  • 动画学习

    动画 分为 组动画,属性动画,渐变动画,其中属性动画包括 普通动画和关键帧动画,其他动弹动画,动画层分为 pres...

  • Android动画

    Android动画分类: 视图动画:补间动画、逐帧动画 属性动画 视图动画 补间动画 可以在xml中定义动画,然后...

  • iOS动画

    iOS动画-从UIView动画说起iOS动画-Transform和KeyFrame动画iOS动画-layout动画...

  • Android动画之视图动画

    分类 Android动画主要包括视图动画和属性动画。视图动画包括Tween动画和Frame动画。Tween动画又包...

  • Android 动画

    android动画分为三种 帧动画,视图动画(补间动画),属性动画逐帧动画 视图动画 属性动画 Window和A...

  • android动画

    动画: 分类:分为视图动画和属性动画,其中视图动画又分为补间动画和逐帧动画。补间动画又分为平移动画、缩放动画、旋转...

  • Android中的动画概述

    动画可以分为三类:View动画,帧动画,属性动画。 一、View动画 1.View动画包括四种:平移动画,缩放动画...

网友评论

      本文标题:动画

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