Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

jQuery not recognizing <embed> element in IE

Avatar of ryangiglio
ryangiglio asked on
Web BrowsersAdobe FlashjQuery
3 Comments1 Solution1112 ViewsLast Modified:
I have a CMS where people can paste the code to embed a YouTube video. The problem is, the CMS uses jQuery lightboxes as modal popups to edit things, and the YouTube embeds are appearing over top of the popup window.

I have read in many places that <embed> elements don't respect the z-index property and just stick themselves on top of everything. You need to include the "wmode" attribute and set it to "opaque" or "transparent" for them to play along. Also, sometimes you need to include "<param name='wmode' value='transparent'> inside the <object element>

I have a simple jQuery function to add the "wmode" attribute to all the "embed" tags on the page, however on IE it simple isn't doing anything. In Firefox the wmode attribute was successfully set on all the elements, but I can see that in IE it isn't being set. However when I edit the text of the embed and add it manually, it works correctly.

Asking the users to add it manually isn't an option. What's wrong with my jQuery that this isn't working?
$(document).ready(function() {
$("div.video object").prepend('<param name="wmode" value="transparent">');
$("div.video embed").attr("wmode", "transparent");				
Avatar of Michel Plungjan
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answers