我对此很陌生,我有一个问题。如何放置音量滑块?谢谢你!!我暂时找不到任何适合我的代码,希望您的帮助
HTML: <a id="play-pause-button" class="fa fa-play">
JavaScript:
<script type="text/javascript">
var audio = new Audio("http://21273.live.streamtheworld.com/LOS40_DANCE.mp3");
$('#play-pause-button').on("click",function(){
if($(this).hasClass('fa-play'))
{
$(this).removeClass('fa-play');
$(this).addClass('fa-pause');
autoplay = true;
audio.play();
audio.muted = false;
}
else
{
audio.muted = true;
$(this).removeClass('fa-pause');
$(this).addClass('fa-play');
}
});
audio.onended = function() {
$("#play-pause-button").removeClass('fa-pause');
$("#play-pause-button").addClass('fa-play');
};
</script>
Run Code Online (Sandbox Code Playgroud)