animation-play-state屬性如何使用

小編給大家分享一下animation-play-state屬性如何使用,希望大家閱讀完這篇文章后大所收獲,下面讓我們一起去探討吧!

成都創(chuàng)新互聯(lián)是一家企業(yè)級(jí)云計(jì)算解決方案提供商,超15年IDC數(shù)據(jù)中心運(yùn)營(yíng)經(jīng)驗(yàn)。主營(yíng)GPU顯卡服務(wù)器,站群服務(wù)器,IDC機(jī)房托管,海外高防服務(wù)器,成都機(jī)柜租用,動(dòng)態(tài)撥號(hào)VPS,海外云手機(jī),海外云服務(wù)器,海外服務(wù)器租用托管等。

animation-play-state屬性是用于指定動(dòng)畫是否正在運(yùn)行或已暫停;可以通過(guò)和JavaScript一起使用,實(shí)現(xiàn)在播放過(guò)程中暫停動(dòng)畫的效果。

animation-play-state屬性如何使用

CSS3  animation-play-state屬性

作用:animation-play-state 屬性規(guī)定動(dòng)畫正在運(yùn)行還是暫停。

語(yǔ)法:

animation-play-state: paused|running;

paused:規(guī)定動(dòng)畫已暫停。

running:規(guī)定動(dòng)畫正在播放。

說(shuō)明:您可以在 JavaScript 中使用該屬性,這樣就能在播放過(guò)程中暫停動(dòng)畫。

注:Internet Explorer 9 以及更早的版本不支持 animation-play-state 屬性。

CSS3  animation-play-state屬性的使用示例

<!DOCTYPE html>
<html>
<head>
<style> 
div
{
width:100px;
height:100px;
background:red;
position:relative;
animation:mymove 5s;
animation-play-state:running;

/* Safari and Chrome */
-webkit-animation:mymove 5s;
-webkit-animation-play-state:running;
}
div:hover{
animation-play-state:paused;
-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>

<div></div>

</body>
</html>

效果圖:

animation-play-state屬性如何使用

看完了這篇文章,相信你對(duì)animation-play-state屬性如何使用有了一定的了解,想了解更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!

新聞標(biāo)題:animation-play-state屬性如何使用
網(wǎng)站網(wǎng)址:http://www.muchs.cn/article36/gjghsg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供Google、外貿(mào)建站、建站公司、虛擬主機(jī)網(wǎng)站設(shè)計(jì)公司、響應(yīng)式網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

微信小程序開發(fā)