dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: background music loop

  1. #1
    Join Date
    Sep 2008
    Posts
    15

    background music loop

    Hi,
    I would like to have a background music loop in my website.
    So far I have been able to include music with an play/stop button, but I can not make it loop. I do not know if this is the right direction. Can somebody please help me with the code below or point me to a good tutoria about this?
    Thanks

    This is the code:

    <head>
    <bgsound id="PlayMusic">
    <script type="text/javascript">
    <!--
    PlayMusic.src="Beauty_of_Hip_Hop.mp3";
    function OnOff() {
    if (PlayMusic.src=="")
    {
    PlayMusic.src="music.mp3";
    OnOffButton.value="Stop";
    } else {
    PlayMusic.src="";
    OnOffButton.value="Play";
    }
    }
    // -->
    </script>
    </head>
    <body bgcolor="#000000" scrollamount="0">
    <input type="button" name="OnOffButton" value="Stop" onClick="OnOff()">
    </body>
    </html>

  2. #2
    Join Date
    Feb 2008
    Posts
    1,666
    The following is how you get the MS IE BGSOUND tag to loop:
    HTML Code:
    <bgsound id="PlayMusic" loop="-1">
    http://msdn.microsoft.com/en-us/libr...34(VS.85).aspx

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles