HTML5网页音乐播放器的示例代码

2020-04-21 08:13:28易采站长站整理

if(timer2!=undefined){
clearInterval(timer2);
}
}

再把播放的音乐停止,并且将播放时间恢复。


function stopM(){
if(mList[index].played){
mList[index].pause();
mList[index].currentTime=0;
flag=false;
}
}

最后的最后,改变下面播放列表的样式:


function clearListBgc(){
document.getElementById("m0").style.backgroundColor = "#E5E5E5";
document.getElementById("m1").style.backgroundColor = "#E5E5E5";
document.getElementById("m2").style.backgroundColor = "#E5E5E5";
document.getElementById("m0").style.color = "black";
document.getElementById("m1").style.color = "black";
document.getElementById("m2").style.color = "black";
}

到此,音乐播放器我们就基本完成了,来看一下动图的效果:

作者:杰瑞教育
出处:http://www.cnblogs.com/jerehedu/