Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Montreal
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Background music

    Hi everybody,
    I have to embed a musical background to a web site. I have found a script, and they gave me the music file. Is there a simple way to have this music play for all the web pages continuously?
    Thanks to all of you
    Hrisula

    Here is the script

    <script>
    var musicsrc="cosmic.mp3"
    if (navigator.appName=="Microsoft Internet Explorer")
    document.write('<bgsound src='+'"'+musicsrc+'"'+' loop="infinite">')
    else
    document.write('<embed src=\"'+musicsrc+'\" hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
    </script>

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Provo, UT
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Does your site use frames?
    If it does that would be cool because then you could just add that script to the frame that shoes all of the time. That would solve your problem. If not. I have no idea unless you popup a window and hope the people will not close it. That might be another Idea though. You could popup a window that has a play and stop button etc. Have fun!

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    Montreal
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Great idea, I did not think of frames!!
    At least this solves half the problem. Thank you MikoLone
    Hrisula

  • #4
    New to the CF scene
    Join Date
    Jun 2002
    Location
    Santa Monica, CA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to modify provided music script?

    The music script provided is very useful! Thanks!

    I was wondering how to do two different modifications to this script:

    1) Provide a toggle to turn the music on and off.

    2) If NOT using frames, and the user turns the music off (or back on) on one page, then navigates to another page on the same site, what's the best way to have the user's last selected music play choice (i.e. off or on) take effect on the new page? Does this get into cookies? Or is there an easier way to track this?

    Thanks!


  •  

    Posting Permissions

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