...

View Full Version : Anyway to compromise?



Sappie
06-07-2007, 09:05 AM
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">Current 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?

_Aerospace_Eng_
06-07-2007, 09:24 AM
Umm...remove style="display:none;" from music.

Sappie
06-07-2007, 10:12 AM
However I do not want the player to show until the inner html is changed.

VIPStephan
06-07-2007, 10:47 AM
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. ;)

Sappie
06-07-2007, 11:00 AM
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. :(

VIPStephan
06-07-2007, 04:09 PM
Well, you could position it outside of the screen and then come back in on user’s demand… or whatever you wanna do.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum