views:

394

answers:

3

I have the following embed tag:

<embed type="application/x-shockwave-flash" width="640" height="505" src="url_to_video" allowscriptaccess="always" allowfullscreen="true"></embed>

I have about five of theses on a page, and I'd like to add the attribute wmode="opaque" to all of them. However, I tried to do it like this and it didnt' work:

$j("embed").attr('wmode','opaque');

Is there another way I can dynamically set the attribute wmode="opaque" ?

Thanks!

+1  A: 

Look at SWFObject

http://www.web-site-scripts.com/flash-charts/online-manual/index.html?fcp_sample_of_usage_swfobject.html

mike clagg
What am I doing wrong here?$j("embed").each(function(){ var so = new SWFObject($j(this).attr("src"), "flash-video", $j(this).attr("width"), $j(this).attr("height"), "8", "#000000");so.addParam("wmode", "opaque");so.write("embed"); });
Rob
are you using a different version of jquery? I just noticed the $j
mike clagg
I'm using .noConflict()
Rob
A: 

I ened up using a regular expression instead of jquery to get this to work.

Rob
A: 

what was the expression you used?

matthew