469,328 Members | 1,274 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

Music on/off button

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
1 11996
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.

Similar topics

4 posts views Thread by Shelly | last post: by
20 posts views Thread by gallery | last post: by
5 posts views Thread by gregrjones | last post: by
14 posts views Thread by gnarl | last post: by
reply views Thread by xoqqa | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.