js隐藏audio美化简化声音播放按钮和进度效果代码
代码语言:html
所属分类:多媒体
代码描述:js隐藏audio美化简化声音播放按钮和进度效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { text-align: center; padding: 10%; background: #1b1b1b; font-family: 'Roboto', sans-serif; } .btn { cursor: pointer; display: inline-block; padding: 30px; background: #94a657; border-radius: 4px; color: #fff; text-transform: uppercase; line-height: 20px; } </style> </head> <body> <audio id="nyan" src="//repo.bfw.wiki/bfwrepo/sound/5c89fd22dea6948307.mp3" preload="metadata" type="audio/mpeg"> Your browser does not support the audio element. </audio> <a class="btn" id="nyan-btn">play / pause</a> <script> var nyan = document.getElementById('nyan'); var nyanBtn = document.getElementById('nyan-btn'); function playPause(song) { if (song.paused && song.currentTime >= 0 && !song.ended) { s.........完整代码请登录后点击上方下载按钮下载查看
网友评论0