Using javascript with jQuery, I am adding an iframe with a youtube url to display a video on a website however the embed code that gets loaded in the iframe from youtube doesnt have wmode="Opaque", therefore the modal boxes on the page are shown beneath the youtube video.
Any ideas how to solve the issue?
&wmode=opaque
didn't work for me (chrome 10) but&wmode=transparent
cleared the issue right up.Try adding
?wmode=transparent
to the end of the URL. Worked for me.recently I saw that sometimes the flash player doesn't recognize
&wmode=opaque
, istead you should pass&WMode=opaque
too (notice the uppercase).I know this is an old question, but it still comes up in the top searches for this issue so I'm adding a new answer to help those looking for one for IE:
Adding
&wmode=opaque
to the end of the URL does NOT work in IE 10...However, adding
?wmode=opaque
does the trick!Found this solution here: http://alamoxie.com/blog/web-design/stop-iframes-covering-site-elements
If you are using the new asynchronous API, you will need to add the parameter like so:
This is based on the google documentation and example here: http://code.google.com/apis/youtube/iframe_api_reference.html
Add
&wmode=transparent
to the url and you're done, tested.I use that technique in my own wordpress plugin YouTube shortcode
Check its source code if you encounter any issue.