css animation-play-state属性怎么用


本文摘自PHP中文网,作者藏色散人,侵删。

css animation-play-state属性规定动画正在运行还是暂停。animation-play-state: paused;表示动画已暂停,animation-play-state: running;表示动画正在播放。

css animation-play-state属性怎么用

作用:animation-play-state 属性规定动画正在运行还是暂停。

语法:

1

animation-play-state: paused|running;

说明:paused 规定动画已暂停。running 规定动画正在播放。

注释:您可以在 JavaScript 中使用该属性,这样就能在播放过程中暂停动画。

css animation-play-state属性使用示例

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

<!DOCTYPE html>

<html>

<head>

<style>

div

{

width:100px;

height:100px;

background:red;

position:relative;

animation:mymove 5s;

animation-play-state:paused;

/* Safari and Chrome */

-webkit-animation:mymove 5s;

-webkit-animation-play-state:paused;

}

@keyframes mymove

{

from {left:0px;}

to {left:200px;}

}

@-webkit-keyframes mymove /* Safari and Chrome */

{

from {left:0px;}

to {left:200px;}

}

</style>

</head>

<body>

<p><strong>注释:</strong>Internet Explorer 9 以及更早的版本不支持 animation-play-state 属性。</p>

<div></div>

</body>

</html>

效果:

7eb21e6949d7a97db63063c4f528159.png

以上就是css animation-play-state属性怎么用的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

css怎么设置超链接字体加粗效果

css改变滚动条样式

css如何实现表单验证功能

css怎么设置边框的宽度

css如何设置透明背景

css的相邻兄弟选择器何时用

如何使用css隐藏滚动条?

html5 border属性怎么设置?html5 table中的border属性介绍

css如何设置文字加粗

css如何设置渐变色

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...