G
Gaffer
I almost have the below script working fine. When the webpage loads you need
to click on the button to start the music, which it does, and then click on
the button to turn it off again. However, when you click the 'turn music
off' button the music does go off, but the button doesn't change back to the
'turn music on' one. So the music can't be turned back on again unless you
refresh the page. Thanks.
--------------------------------------------------------
<script language="JavaScript"><!--
function musicOff() {
document.midi.stop()
}function musicOn() {
document.midi.play()
}
function changeButton() {
if (document.onoff.B1.value=='Turn music on')
{
document.onoff.B1.value='Turn music off';
musicOn()
}
else {
document.onoff.B1.value='Turn music off';
musicOff()
}
}
//-->
</script>
<embed name="midi" src="psychotune.mp3" width="0" height="0"
autostart="false">
<form name="onoff">
<input type="button" value="Turn music on" name="B1"
onClick="changeButton()" style="color: #000000; background-color: #FFFFFF;
font-family: Tahoma; font-size: 7pt">
</form>
to click on the button to start the music, which it does, and then click on
the button to turn it off again. However, when you click the 'turn music
off' button the music does go off, but the button doesn't change back to the
'turn music on' one. So the music can't be turned back on again unless you
refresh the page. Thanks.
--------------------------------------------------------
<script language="JavaScript"><!--
function musicOff() {
document.midi.stop()
}function musicOn() {
document.midi.play()
}
function changeButton() {
if (document.onoff.B1.value=='Turn music on')
{
document.onoff.B1.value='Turn music off';
musicOn()
}
else {
document.onoff.B1.value='Turn music off';
musicOff()
}
}
//-->
</script>
<embed name="midi" src="psychotune.mp3" width="0" height="0"
autostart="false">
<form name="onoff">
<input type="button" value="Turn music on" name="B1"
onClick="changeButton()" style="color: #000000; background-color: #FFFFFF;
font-family: Tahoma; font-size: 7pt">
</form>