By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,598 Members | 1,897 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,598 IT Pros & Developers. It's quick & easy.

Music on/off button

P: n/a
Is it possible to change the following code so that the music is 'off' when
the page is loaded and the user gets the option to turn it on?

---------------------------------------------------
<script language="JavaScript"><!--
function musicOff() {
document.midi.stop()
}function musicOn() {
document.midi.play()
}
function changeButton() {
if (document.onoff.B1.value=='Turn music off') {
document.onoff.B1.value='Turn music on';
musicOff()
}
else {
document.onoff.B1.value='Turn music off';
musicOn()
}
}
//-->
</script><embed name="midi" src="psychotune.mp3" width="95" height="95"
hidden>
<form name="onoff">
<input type="button" value="Turn music off" name="B1"
onClick="changeButton()" style="color: #000000; background-color: #FFFFFF;
font-family: Tahoma; font-size: 10pt">
</form>

---------------------------------------------------
--
Gaffer
Sep 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Gaffer said the following on 9/18/2005 8:31 AM:
Is it possible to change the following code so that the music is 'off' when
the page is loaded and the user gets the option to turn it on?
<--snip-->
<embed name="midi" src="psychotune.mp3" width="95" height="95"
hidden>


autostart="false"

alt.html and comp.info.www.authoring.html are that way ======>

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.