On the page is inserted iframe c youtube:

<iframe width="425" height="349" src="http://www.youtube.com/embed/jZNeRQnjZic" frameborder="0"> 

This iframe contains an embed tag. You need to "reach" this embed to add the wmode = "opaque" attribute to it. How can I do that?

    2 answers 2

    Try adding a parameter to the end of the link.

     <iframe width="425" height="349" src="http://www.youtube.com/embed/jZNeRQnjZic?wmode=opaque" frameborder="0"> 

    This is how the parameter for YouTube player is transferred, and you cannot select elements inside the frame.

    • Yes it works. Thank! :) And how do you know that the attribute in youtube can be transferred? - xhr
    • Faced a problem when the video player overlapped the drop-down menu in all of it, and I found out - makregistr
     $("iframe").attr({wmode: "opaque"}); 

    Or if you need to add a specific frame, add ID

     <iframe id="anime" width="425" height="349" src="http://www.youtube.com/embed/jZNeRQnjZic" frameborder="0"></iframe> 

    And so this code

     $("iframe #anime").attr({wmode: "opaque"}); 
    • No, it is not necessary to add an iframe attribute, but an element contained in this iframe. And iframe contains a completely different page with html-head-body and already somewhere in the body there is an embed (containing in this case a flash clip from youtube). And this embed you need to add the attribute wmode = "opaque" - xhr