当前位置: 代码迷 >> Web前端 >> 静音的例证
  详细解决方案

静音的例证

热度:144   发布时间:2012-07-05 07:59:18.0
静音的例子
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<audio id="background_audio" autoplay="autoplay"></audio>

<input type="button" onclick="audio.play()" value="play" />
<input type="button" onclick="audio.muted=true" value="mute" />
<input type="button" onclick="audio.muted=false" value="sound" />
</body>

</html>
<script language=javascript >
var audio = document.getElementById("background_audio");
audio.src = "r/full.mp3" ;
</script>
  相关解决方案