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!

HWD
  • 1,547
  • 7
  • 36
  • 72

2 Answers2

1

Look at SWFObject

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

mike clagg
  • 830
  • 7
  • 12
  • 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"); }); – HWD May 12 '10 at 00:04
  • 1
    are you using a different version of jquery? I just noticed the $j – mike clagg May 12 '10 at 20:47
0

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

HWD
  • 1,547
  • 7
  • 36
  • 72