在IE下可以通过<bgsound>来实现,但firefox下不知如何实现....
ie下可这样:
function change_music(id,u){
document.getElementById(id).src=u;
}
<bgsound id="sound_tag" />
<a href="#" onmouseover="change_music('sound_tag','Not Afraid.mp3');" onmouseout="change_music('sound_tag')">声音</a>
firefox下,望指点...
ie下可这样:
function change_music(id,u){
document.getElementById(id).src=u;
}
<bgsound id="sound_tag" />
<a href="#" onmouseover="change_music('sound_tag','Not Afraid.mp3');" onmouseout="change_music('sound_tag')">声音</a>
firefox下,望指点...
刚用html5的<audio>试了下,不过在firefox下,只支持ogg,wav,
chrome可支持ogg,wav,mp3