16楼
谢谢黑黑{:4_187:} 小辣椒 发表于 2022-8-2 21:51
谢谢黑黑
你先试一下,不行再说 马黑黑 发表于 2022-8-2 21:49
16楼
音乐还是不能停止 小辣椒 发表于 2022-8-2 22:04
音乐还是不能停止
<style>
#papa { margin:auto; width: 1200px; height: 739px;top: 150px; display: flex; justify-content: center; background: #000 url('http://wx.ttt.dj/data/nfs/img/002.jpg') no-repeat center/cover; perspective: 2000px; box-shadow: 4px 4px 24px #000; font-size: 18px; position: relative; }
#papa h2 { position: absolute; margin-top: 20px; font: bold 30px / 30px sans-serif; color: #222; text-shadow: 1px 2px 3px #aaa; }
#wrapper { position: absolute; left: 40%;top: 220px; width: 300px; height: 300px; transform-style: preserve-3d; transform: rotateX(-15deg) rotateY(-20deg); animation: rot1 4s linear forwards; }
#ball { position: absolute; left: -560px; top: 100px; width: 481px; height: 221px; border-radius: 50%; transform: translateZ(20px);}
#btnPlay { position: absolute; left: 40px; bottom: 40px; outline: none; cursor: pointer; }
#yyMsg { position: absolute; left: 110px; bottom: 40px; color:Black; }
#btnBegin { position: absolute; bottom: 40px; outline: none; cursor: pointer; }
#mkMsg { position: absolute; left: 300px; bottom: 40px; }
</style>
<div id="papa">
<h2></h2>
<div id="wrapper"><img id="ball" src="https://pic.imgdb.cn/item/62e89dd416f2c2beb192d047.gif" alt="" /></div>
<input id="btnPlay" type="button" value="音乐停" />
<span id="yyMsg">背景音乐 -爱难求情难断</span>
<input id="btnBegin" type="button" value="暂停" />
<span id="mkMsg"></span>
</div>
<script>
let aud = new Audio();
aud.src = 'https://wx.ttt.dj/data/nfs/mp3/anqiu.mp3';
aud.loop = true;
aud.autoplay = true;
btnBegin.onclick = () => {
flag = !flag;
flag ? (TT = setInterval(mkBox, 2000), btnBegin.value = '暂停') : (clearInterval(TT), btnBegin.value = '继续');
}
btnPlay.onclick = () => aud.paused ? aud.play() : aud.pause();
aud.addEventListener('playing', () => btnPlay.value = '音乐停');
aud.addEventListener('pause', () => btnPlay.value = '音乐放');
</script>
现在这个音乐可以停止就是和我开始那样,暂停文字在了 这个音乐可以关闭,但这个暂停文字在了 小辣椒 发表于 2022-8-2 22:27
这个音乐可以关闭,但这个暂停文字在了
前面弄不清楚你的描述,现在搞懂了:
<style>
#papa { left: -318px; width: 1200px; height: 739px; display: flex; justify-content: center; background: #000 url('http://wx.ttt.dj/data/nfs/img/002.jpg') no-repeat center/cover; perspective: 2000px; box-shadow: 4px 4px 24px #000; font-size: 18px; position: relative; }
#papa h2 { position: absolute; margin-top: 20px; font: bold 30px / 30px sans-serif; color: #222; text-shadow: 1px 2px 3px #aaa; }
#wrapper { position: absolute; left: 40%;top: 220px; width: 300px; height: 300px; transform-style: preserve-3d; transform: rotateX(-15deg) rotateY(-20deg); animation: rot1 4s linear forwards; }
#ball { position: absolute; left: -560px; top: 100px; width: 481px; height: 221px; border-radius: 50%; transform: translateZ(20px);}
#btnPlay { position: absolute; left: 40px; bottom: 40px; outline: none; cursor: pointer; }
#yyMsg { position: absolute; left: 110px; bottom: 40px; color:Black; }
#btnBegin { position: absolute; bottom: 40px; outline: none; cursor: pointer; }
#mkMsg { position: absolute; left: 300px; bottom: 40px; }
</style>
<div id="papa">
<h2></h2>
<div id="wrapper"><img id="ball" src="https://pic.imgdb.cn/item/62e89dd416f2c2beb192d047.gif" alt="" /></div>
<input id="btnPlay" type="button" value="音乐停" />
<span id="yyMsg">背景音乐 -爱难求情难断</span>
<span id="mkMsg"></span>
</div>
<script>
let aud = new Audio();
aud.src = 'https://wx.ttt.dj/data/nfs/mp3/anqiu.mp3';
aud.loop = true;
aud.autoplay = true;
btnPlay.onclick = () => aud.paused ? aud.play() : aud.pause();
aud.addEventListener('playing', () => btnPlay.value = '音乐停');
aud.addEventListener('pause', () => btnPlay.value = '音乐放');
</script>
小辣椒 发表于 2022-8-2 21:11
@红影
亲爱的,想套用你的,感觉音画直接用这个播放器漂亮,就捣鼓成这样了
很漂亮啊,特别温馨画面{:4_187:} 小辣椒 发表于 2022-8-2 21:08
爱难求情难断(抖音完整版)
编曲:鹏鹏音乐
{:4_172:}狡猾狡猾的小辣椒 美好的图画和声音扑面而来{:4_178:} 小辣椒 发表于 2022-8-2 21:34
今天一个晚上5个活动作业完成
也不能太超前了哈{:4_172:} 樵歌 发表于 2022-8-3 19:15
也不能太超前了哈
樵哥哥,今天应该是几号的? 小辣椒 发表于 2022-8-3 19:23
樵哥哥,今天应该是几号的?
今天中伏第十天,成{:4_173:}
页:
1
[2]