Question

I am trying to set a div over the youtube video.I have tried setting wmode:transparent and opaque but the video disappears.Is there any other way?

var params = { allowScriptAccess: "always"};
swfobject.embedSWF(
        "http://www.youtube.com/apiplayer?&video_id=9_So9QyozqQ&enablejsapi=1&version=3&playerapiid=ytplayer", 
        "ytplayer", "229", "209", "8", null, null, params);
}
Était-ce utile?

La solution

The swf object is a windowed element. Windowed elements are always drawn over windowless elements, and unfortunately most other html elements are indeed windowless.

Another windowed element is an iframe. See this link. A way to accomplish what you want is to use an iFrame to mask the swf object. You can place the iframe on top of the swf object by giving it a higher z-index. You can then make the iframe transparent, which basically cuts a hole in your windowed elements layer, showing the underlying windowless elements.

Cheers

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top