2024-04-27 23:08:28
59阅读
//此处粘贴代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
.music-play {
animation: rightWhirl 5s linear infinite;
animation-play-state: running;
animation-fill-mode: forwards;
}
.music-paused {
animation-play-state: paused;
}
@keyframes rightWhirl {
0% {
-webkit-transform: rotate(0)
}
100% {
-webkit-transform: rotate(360deg)
}
}
</style>
</head>
<body>
<img id="image" src="http://good1230.com/dist/server/images/user/1613695591.jpg" class="music-play">
<button id="paused">暂停</button>
<button id="play">继续</button>
</body>
<script type="text/javascript">
const img = document.getElementById('image')
const play = document.getElementById('play')
const paused = document.getElementById('paused')
if (img) {
play.onclick = function () {
img.className = 'music-play'
}
paused.onclick = function () {
img.className = 'music-play music-paused'
}
}
</script>
</html>
最后生成于
2024-06-22 12:07:45
热门推荐:
此内容有帮助 ?
0