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属性怎么用的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

什么是对html的补充,可以使网页形式和内容分离?

css能做什么

css里上下居中怎么弄?

使用html和css的新特性实现响应式布局

详解css行内样式、内嵌样式与外部引用样式的使用方法

css怎么去掉div边框

css如何禁止a标签跳转

css选择器的分类有哪些

css中inline-block什么意思

css字体样式属性有哪些

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




打赏

取消

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

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

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

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

评论

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