Results 1 to 1 of 1

Thread: start/stop music javascript not working in opera

  1. #1
    Join Date
    Apr 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default start/stop music javascript not working in opera

    i am using this script to display a start/stop music button on site, but it only works with IE. in opera i do see the button but clicking on it does nothing. can yall help me out? whats wrong with code and what do i have to change? thanks!
    also how can i make the same button start/stop an animation besides the music?

    Code:
    <BGSOUND id=BGSOUND_CTRL src="introfiles/bgmusic.wav">
    
    <script type="text/javascript">
    var flip = "Stop Music";
    function toggle() {
    if (flip == "Stop Music") {
    flip = "Start Music";
    document.all['BGSOUND_CTRL'].src=""
    str ='<input name="dUit" type="button" value="Start Music" ';
    str+='class="midCtrl" onclick="toggle();">';
    document.getElementById('midCtrl').innerHTML=str;
    }
    else {
    flip = "Stop Music";
    document.all['BGSOUND_CTRL'].src="introfiles/bgmusic.wav"
    str ='<input name="dUit" type="button" value="Stop Music"';
    str+='class="midCtrl" onclick="toggle();">';
    document.getElementById('midCtrl').innerHTML=str;
    }
    }
    </script>
    <div id="midCtrl" class="midCtrl">
    <input name="dUit" type="button" class="midCtrl" onclick="toggle();" value="Stop Music">
    </div>
    Last edited by keyboard; 11-14-2013 at 07:56 PM. Reason: Format: Code Tags [code][/code]

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •