【发布时间】:2016-01-17 03:46:10
【问题描述】:
我正在尝试实现一个播放音频的按钮。我不想有滑块。
有没有办法去掉滑块,或者改用按钮的图像?
当前代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Music</title>
<style type="text/css">
body {
color:transparent;
}
</style>
</head>
<body onLoad="RandomSong();">
<audio id="content" src="background1.mp3" controls></audio>
<script>
function RandomSong() {
var Music = ["background1.mp3","background2.mp3","background3.mp3","background4.mp3","background5.mp3"];
var randomCode = Math.floor(Math.random()*Music.length);
document.getElementById("content").value = "mp3=" + Music[randomCode] + "&showslider=0&width=5&loop=1&autoplay=0&volume=50";
}
</script>
</body>
</html>
【问题讨论】:
-
到目前为止你有什么代码?
-
我已经尝试了很多东西,我什至已经让图像显示出来了。我只需要它循环播放声音
-
pastebin.com/2c4wSuqZ 我的音频工作正常,无论如何我可以用图像替换播放器吗?更好的是,无论如何我可以隐藏滑块,只有播放按钮可见?
-
请edit您的问题包含您的代码。
-
@Ajean 完成,添加代码