网站公告
点击问题反馈。微信登陆的用户请及时在个人中心设置登陆密码,并且牢记自己的用户名。
头像上传问题点击此处

css3中的播放方式animation-timing-function属性详解

已有 40 次阅读 2019-4-14 13:24 系统分类:成长记录

http://www.php.cn/css-tutorial-413126.html

animation-timing-function属性

在CSS3中,我们可以使用animation-timing-function属性来设置动画的播放方式,所谓的“播放方式”主要用来指定动画在播放时间内的速率。其中,animation-timing-function属性跟transition-timing-function属性类似,大家可以对比理解记忆一下。

语法:

1

animation-timing-function:取值;

说明:

animation-timing-function 属性取值跟transition-timing-function属性取值一样,共有5种,具体如下:

11-5-1.png

举例:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title>CSS3 animation-timing-function属性</title>

    <style type="text/css">

        @-webkit-keyframes mytransform

        {

            0%{ }

            100%{width:300px;}

        }

        div

        {

            width:100px;

            height:50px;

            text-align:center;

            line-height:50px;

            border-radius:0;

            background-color:#14C7F3;

            -webkit-animation-name:mytransform;

            -webkit-animation-duration:5s;

            -webkit-animation-timing-function:linear;

        }

        div+div

        {

            margin-top:10px;

        }

        #div1{-webkit-animation-timing-function:linear;}

        #div2{-webkit-animation-timing-function:ease;}

        #div3{-webkit-animation-timing-function:ease-in;}

        #div4{-webkit-animation-timing-function:ease-out;}

        #div5{-webkit-animation-timing-function:ease-in-out}

    </style>

</head>

<body>

    <div id="div1">linear</div>

    <div id="div2">ease</div>

    <div id="div3">ease-in</div>

    <div id="div4">ease-out</div>

    <div id="div5">ease-in-out</div>

</body>

</html>

效果如下:

GIF.gif

以上就是对css3中的播放方式animation-timing-function属性详解的全部介绍,如果您想了解更多有关CSS3教程,请关注PHP中文网。

以上就是css3中的播放方式animation-timing-function属性详解的详细内容,更多请关注php中文网其它相关文章!


路过

鲜花

握手

雷人

作者的其他最新日志全部

facelist

您需要登录后才可以评论 登录 | 新会员加入

评论 (0 个评论)

还没人评论哦