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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Anyway to compromise?

    I'm sorry that I do not have a website for illustration.

    Following is a simplified version of the code.

    <html>
    <head>
    <title>Music</title>
    </head>

    <body>

    <div id="main">
    <a href="#" onClick="document.getElementById('main').innerHTML=document.getElementById('music').innerHTML">Curre nt Music</a>
    </div>

    <div id="music" style="display:none;">
    <object width="300" height="80">
    <param name="movie" value="http://media.imeem.com/m/w_ivzEAy8S"></param>
    <param name="wmode" value="transparent"></param>
    <embed src="http://media.imeem.com/m/w_ivzEAy8S" type="application/x-shockwave-flash" autoplay="true" width="300" height="80" wmode="transparent"></embed></object>
    </div>

    </body>
    </html>
    Is there anyway to play the music before clicking on the link beside using iframe and setting it as background music?

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Umm...remove style="display:none;" from music.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    However I do not want the player to show until the inner html is changed.

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,677
    Thanks
    6
    Thanked 1,008 Times in 981 Posts
    How about visibility: hidden;? Or, you can put the object element into the head section of your document. However, you must not specify a size or a display type then. I guess with some DOM scripting you can get the player obey your (or the user’s) actions then.
    However, note that it is considered bad practice to have music playing automatically without the user’s choice to switch it on when/if she wants. You shouldn’t take Myspace as example.

  • #5
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    How about visibility: hidden;? Or, you can put the object element into the head section of your document. However, you must not specify a size or a display type then. I guess with some DOM scripting you can get the player obey your (or the user’s) actions then.
    However, note that it is considered bad practice to have music playing automatically without the user’s choice to switch it on when/if she wants. You shouldn’t take Myspace as example.
    "visibility: hidden;" does not work. I'm not following myspace's example, I understand how irritating it is >.<

    The coding is just an example. As long as I "leave/switch" the div layer, the music stops even if the visitor has let the player begins.

  • #6
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,677
    Thanks
    6
    Thanked 1,008 Times in 981 Posts
    Well, you could position it outside of the screen and then come back in on user’s demand… or whatever you wanna do.


  •  

    Posting Permissions

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