HTML页面背景音乐控制

//兼容ie,chrome,safari.

<object  id="AudioID" type="application/x-mplayer2" data="images/sound.mp3" style=" display:none;">
           <param name="src" value="images/sound.mp3">
           <param name="autostart" value="true"/>
           <param name="controller" value="false"/>
           <param name="volume" value="100"/>
           <param name="loop" value="true"/>
           <param name="playcount" value="99"/>
           <param name="showaudio controls" value="1"/>
           <param name="mute" value="true" />
           <param name="uiMode" value="invisiblei" />  </object> 
           <img id="Off" src="images/Music_01.gif" value="静音" onclick="MenuOff()" style="cursor:pointer">
           <img id="On" src="images/Music_02.gif" value="撤消静音"  style="display:none;cursor:pointer" onclick="MenuOn()">

  

<script>
function MenuOff(){
      $("#On").css("display","block");
      $("#Off").css("display","none");
      $("#AudioID").attr("mute","true")
  }
function MenuOn(){
      $("#On").css("display","none");
      $("#Off").css("display","block");
      $("#AudioID").attr("mute","false")
}
</script>

HTML页面背景音乐控制,布布扣,bubuko.com

HTML页面背景音乐控制

上一篇:linux服务器环境下安装redis


下一篇:HTML父子页面通信问题(showModalDialog)