css中animation-play-state属性如何实现

小编给大家分享一下css中animation-play-state属性如何实现,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

网站建设哪家好,找成都创新互联公司!专注于网页设计、网站建设、微信开发、小程序开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了新沂免费建站欢迎大家使用!

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

css中animation-play-state属性如何实现

css animation-play-state属性怎么用?

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

语法:

animation-play-state: paused|running;

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

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

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

<!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>

效果:

css中animation-play-state属性如何实现

以上是css中animation-play-state属性如何实现的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!

文章题目:css中animation-play-state属性如何实现
本文地址:https://www.cdcxhl.com/article20/geppco.html

成都网站建设公司_创新互联,为您提供服务器托管手机网站建设建站公司网站设计公司商城网站网站改版

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都定制网站网页设计