Youtube Embedded Video Hides My JavaScript Popups

I tried playing with z-index and also tried setting wmode to “opaque”. There was nothing to work.

It hides my pop-up 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 indicated below, using the embed problem and opaque wmode solves the problem. But I can't find a solution for the new YouTube embed style using iframe

+3
source share
2 answers

Embedded flash 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>
+2
source

You can add wmode when working with iframes. Add

?wmode=transparent 

into the iframe src parameter. This fixed it for me.

+1
source

Source: https://habr.com/ru/post/1787203/


All Articles