문제

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 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="";

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top