|
Posted by Gaffer on 09/19/05 00:01
"Neredbojias" <neredbojias@neredbojias.com> wrote in message
news:MPG.1d9779f89a1d55e0989855@news.intergate.com...
> With neither quill nor qualm, Gaffer quothed:
>
>> 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 begin with, you're using archaic javascript. Update your code by
> using document.getElementById("xxx"). etc., so you can address any real
> problem logically.
>
>
>
OK, I don't exactly know how to update the code at this time, it's all new
to me. Can my original problem in hand be fixed?
--
Gaffer
Navigation:
[Reply to this message]
|