Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: how to get bg music to continue playing

  1. #1
    Join Date
    Jul 2006
    Posts
    95
    Thanks
    21
    Thanked 0 Times in 0 Posts

    Default how to get bg music to continue playing

    On the main webpage, I use the following javascript to create a link to the popup window of a sub webpage.

    <a href="javascript://" onClick="window.open('http://filename.htm','','menubar=no,status=no,scrollbars=no,top=200,left=200,toolbar=no,width=800,height=600')">

    The main webpage has embedded background music. When I click on the link to open the popup sub webpage, the background music of the main webpage stopped. How can I let the music of the main webpage to continue even if the sub webpage is opened?

    The code I use for the embedded music is :
    <EMBED src=music.wma hidden=true LOOP="true"
    AUTOSTART="TRUE">


    Any help would be appreciated. Thanking in advance.

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Code:
     
    <embed src="file.wma" loop="1" autostart="1" hidden="1" \>

  3. #3
    Join Date
    Jul 2006
    Posts
    95
    Thanks
    21
    Thanked 0 Times in 0 Posts

    Default

    Thanks Pissa, but the music still stop when I click to open the subpage.

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Could you provide a link to the site where the problem is occuring?
    - Mike

  5. #5
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Code:
    <a href="javascript://" onClick="window.open('http://filename.htm','','menubar=no,status=no,scrollbars=no,top=200,left=200,toolbar=no,width=800,height=600')">
    Don't do that. The javascript:// part is the problem. Here's an untested solution.
    Code:
    <a href="#" onClick="function(){window.open('http://filename.htm','','menubar=no,status=no,scrollbars=no,top=200,left=200,toolbar=no,width=800,height=600');return false;}">

  6. #6
    Join Date
    Jul 2006
    Posts
    95
    Thanks
    21
    Thanked 0 Times in 0 Posts

    Default

    Thanks to mburt, especially blm126 for providing the script.

    It worked when I removed "function(){" and ";return false;}" ,ie:

    <a href="#" onclick="window.open('http://filename.htm','','menubar=no,status=no,scrollbars=no,top=200,left=200,toolbar=no,width=800,height=600')">

  7. #7
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    The return false part is important. Here's a better way to do it.
    Put this in the < head> tag
    Code:
    <script type="text/javascript">
    function openWindow(file){
    window.open(file,'','menubar=no,status=no,scrollbars=no,top=200,left=200,toolbar=no,width=800,height=600')
    return false;
    }
    </script>
    Then your link
    Code:
    <a href="#" onclick="openWindow('http://somefile.com')">Link</a>

  8. #8
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    When you use a blank bookmark (#) I think that would stop the music too. But it may not, so ignore me if I'm wrong
    - Mike

  9. #9
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Well it's called an anchor. And since anchors only redirect within the page, the browser should continue to play the music. And then with the return false part the browser does nothing.

  10. #10
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Anchors bring IE users to the top of the page, magically making a bookmark there, which may stop the music.
    - Mike

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
  •