Last Updated: February 25, 2016
·
1.989K
· ghedamat

fix youtube embed z-index problems

youtube embedded videos (iframes) usually prevent other DOM elements from the host page to be displayed over them.

to fix this add simply the

wmode=opaque

parameter to your embed url

or specify the wmode in the call to the YouTube javascript API

player = new YT.Player('player', {
      height: '381',
      width: '681',
      wmode: 'opaque', // Add this!!
      ...

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside