Youtube embedded video keeps hiding my JavaScript popup dialogs
I tried playing with z-index, and also tried setting the wmode to "opaque". Nonthing worked..
It keeps hiding my popup dialogs..
Here is the current iframe code
<iframe title="YouTube video player" class="youtube-player" type="text/html" width="450" height="297" src="http://www.youtube.com/embed/glqpoDfuAwk" frameborder="0" ></iframe>
EDIT: As pointed out below, using "embed" and opaque wmode solves the problem. But I cannot find any solution for YouTube's new sty开发者_JS百科le of embedding using iframe
The flash embed code still works (Demo):
<object width="640" height="385">
<param name="movie" value="http://www.youtube.com/v/vx2u5uUu3DE"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<param name="wmode" value="opaque"></param>
<embed src="http://www.youtube.com/v/vx2u5uUu3DE"
type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" width="640" height="385" wmode="opaque"></embed>
</object>
You can still add the wmode when dealing with an iframe. Add
?wmode=transparent
to the iframe src-parameter. This fixed it for me.
精彩评论