Reply to Help with a script

Your name:

Reply:


Posted by Gaffer on 09/18/05 22:42

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>


--------------------------------------------------------

--
Gaffer

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация