Background Sound
Question: How do I set a background sound on my Web page?
Answer:
In some client configurations, there is no easy way to
stop the background sound
from within the browser
(2) That said, there are ways to play background sound on your pages.
In most browsers, <SPAN ID="soundBlock"> <EMBED ID="bkgroundID" SRC="bkground.mid" LOOP=TRUE AUTOSTART=TRUE HIDDEN=TRUE MASTERSOUND> </SPAN> To stop the background sound, you can use this function: function stopBackgroundSound() { document.getElementById('soundBlock').innerHTML=''; }
If your target browser is Microsoft Internet Explorer
(for example, in an intranet), then
you can also use the Explorer-specific <BGSOUND ID="bkgroundID" LOOP=0 VOLUME="-600" SRC="bkground.mid">Here, again, bkground.mid stands for the name of the sound file that you actually want to play.
|
Copyright © 1999-2011, JavaScripter.net.