开发者

How to mute background music in html page

As per clients requirement, i have added a background music to webpage. I have set the music in loop mode to play it continuous. I have used <BGSOUND> tag to play the audio. The problem here is how to implement mute button so that client can mute the playing sound. I know nowadays its a bad idea to play automatic background music, but its the clients requirement. The page is simple static html.

Do anybody have the idea how to provide button to mute开发者_Python百科 background sound?

Thanks for sharing your time.


Make sure your BGSOUND has it's id attribute set, then it should be as simple as setting
the src attribute to blank :

document.all["bgsound_id"].src="";

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜