But enough of this theater. I sure do love cats.



← View All Topics

Comments/embedded items

* Godfather Tue Sep 30th, 2008 3:55pm

Comments (the mouse over comment preview on the right) will drop behind embedded items (eg. youtube clips).
* El Cap Tue Sep 30th, 2008 3:56pm

Suggested fix: script to ensure the following parameter is in the <embed /> tag...

wmode="transparent"

This and a z-index on the div (that hovers over) will mean it will appear in front of it!

I've come across this problem before! :)
* oweff Tue Sep 30th, 2008 7:15pm

El Cap, have you any ideas or recipes for injecting this param with javascript? I think ideally it would be great to do something like this on the entire page where it finds all <embed> tags and inserts a <param name="wmode" value="transparent"> in each of them.
* coolguy Tue Sep 30th, 2008 11:59pm

Try this...

<script language="Javascript" type="text/javascript">
document.observe("dom:loaded", function() {
$$('embed').each(function(s) {
var embed_param = document.createElement('param');
embed_param.setAttribute('name', 'wmode');
embed_param.setAttribute('value', 'transparent');

s.appendChild(embed_param);
});
});
</script>

There may be a slightly more efficient way to do it... It's been a while since I've used prototype.js. I could do it much more eloquently in mootools ;)
* oweff Wed Oct 1st, 2008 12:07am

Excellent, will give it a shot..
* oweff Wed Oct 1st, 2008 12:14am

Hmm negative.

The param is inserted correctly, but apparently the object cannot be altered dynamically. It has to be set when the page renders.

* http://www.csschat.com/showthread.php?t=8510
* coolguy Wed Oct 1st, 2008 12:35am

Ahhh, yeah... that makes sense. I guess it'd have to be done server side
* El Cap Wed Oct 1st, 2008 5:12am

Does it use PHP? I would use a script to first strip out any existing wmode's to prevent duplicates with a preg_replace and then use preg_replace again to insert into all embed tags on the page.

Regex to remove existing ones would be:

"/wmode=\"(.*?)\"/i" replace with ""

Then you could search for <embed and replace with <embed wmode="transparent"
* oweff Wed Dec 17th, 2008 4:28pm

A little bit has changed since this this thread started.

We now construct our own embed codes when certain URLs are posted. (right now, only YouTube)
Doing it this way, allows us to force a wmode="transparent" in there -- which seems to be working so far.

If you were logged in, the place to post a response would be here.

Get The Bookmarklet!

Post to Bordom

Drag this button up to your browser toolbar to post to Bordom with a single click.

Join the Par-tay



ADVERTISEMENT
Cornify
© 2003-2009 bordom.net
Subscribe via Feed or Email

LabsAPITerms of Use

“Don't struggle too much. You'll only die tired.”
—deepsixmaster