cookie fir javascript music

Discussion in 'HTML & Website Design' started by mitko_to, Mar 10, 2008.

  1. #1
    Hay,
    I have a javascript code to play a sound in my website.But when I click on a link in the site and the page comes on , the sound stop. I need a cookie or differnt javascript code to play the sound all the times, that the visitor is browsing in the site ,whit option on/off :
    That`s my code
    <script language="JavaScript"><!--
    function musicOff() {
    document.midi.stop()
    }function musicOn() {
    document.midi.play()
    }


    function changeButton() {
    if (document.onoff.B1.value=='Turn off') {
    document.onoff.B1.value='Turn on';
    musicOff()
    }
    else {
    document.onoff.B1.value='Turn off';
    musicOn()
    }
    }
    //-->
    </script>

    <form name="onoff">
    Sound:
    <input type="button" value="Turn off" name="B1" onClick="changeButton()" style="background-color:#356ca5;" class="c" OnMouseOver="this.className='d';" OnMouseOut="this.className='c';" border="0">
    </form>
    <embed name="midi" src="./css/1.wav" width="0" height="0" loop=1 hidden>
     
    mitko_to, Mar 10, 2008 IP