国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

javascript - 移動端css動畫播放狀態暫停在ios不起作用 animation-play-state

瀏覽:158日期:2023-06-04 14:46:04

問題描述

移動端css動畫播放狀態暫停在ios不起作用 animation-play-state

我想點擊圖片圖片靜止,再點一下圖片繼續旋轉。在安卓手機上可以實現,但是在ios,第一次點擊圖片繼續旋轉,沒有靜止動作,反而在第二點擊的時候,圖片在第一次點擊的位置閃一下,繼續旋轉。

<style type='text/css'>#wls .musicCon{width: 35px;height: 35px;position:fixed;top:15px;right:15px;z-index: 9999; } img.rotate{ animation:spin 4s infinite linear; -moz-animation:spin 4s infinite linear; -webkit-animation:spin 4s infinite linear;-webkit-animation-play-state: running; -moz-animation-play-state: running; animation-play-state: running; -ms-animation-play-state: running; -o-animation-play-state: running;}@keyframes spin { 0%{ transform:rotate(0deg); } 100%{ transform:rotate(360deg); }}@-o-keyframes spin { 0% {-o-transform: rotate(0deg); } 100%{ -o-transform:rotate(360deg); }}@-moz-keyframes spin { 0% {-moz-transform: rotate(0deg); } 100%{ -moz-transform:rotate(360deg); }}@-webkit-keyframes spin { 0% {-webkit-transform: rotate(0deg); } 100%{ -webkit-transform:rotate(360deg); }} img.pauseWalk { animation:spin 4s infinite linear; -moz-animation:spin 4s infinite linear; -webkit-animation:spin 4s infinite linear; -webkit-animation-play-state: paused; -moz-animation-play-state: paused; animation-play-state: paused; -ms-animation-play-state: paused; -o-animation-play-state: paused;}</style><body id='wls'> <img src='http://www.intensediesel.com/wenda/imgage/music.png' /> <audio autoplay='autoplay' loop='loop' id='bgm'> <source src='http://www.intensediesel.com/wenda/music/bgm.mp3' type='audio/mpeg'> <source src='http://www.intensediesel.com/wenda/music/bgm.ogg' type='audio/ogg'></audio><script> var num=1; $('#wls .musicCon').bind('click',function(){if(num==1){ $(this).removeClass('rotate'); $(this).addClass('pauseWalk'); $('#bgm')[0].pause(); num++; return num;}else{ $(this).removeClass('pauseWalk'); $(this).addClass('rotate'); $('#bgm')[0].play(); num=1; return num;} })</script></body>

問題解答

回答1:

iOS 上 animation-play-state 失效.

你可以把狀態疊加. 如下示例:鏈接描述

標簽: JavaScript
相關文章:
主站蜘蛛池模板: 德化县| 化隆| 吴忠市| 沅江市| 博乐市| 扎兰屯市| 白沙| 阿克苏市| 台中市| 洞头县| 淮滨县| 布尔津县| 易门县| 同德县| 河津市| 甘德县| 崇州市| 宁远县| 龙井市| 抚远县| 黄大仙区| 老河口市| 诏安县| 广丰县| 融水| 香河县| 蓬莱市| 泰州市| 皋兰县| 唐山市| 新宾| 通河县| 济源市| 阜平县| 九寨沟县| 密云县| 广州市| 乐山市| 深州市| 乌兰察布市| 张家港市|