2013-02-20 59 views
1

我正在嘗試在vimeo視頻上浮動div,我認爲這很簡單,但似乎不是。這裏的HTML:在vimeo視頻上浮動div

<div id="wrap"> 
<iframe id="video" src="http://player.vimeo.com/video/15888399" width="100%" height="100%" wmode="transparent" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> 
</div> 

一個JS提琴在這裏太:http://jsfiddle.net/wfX55/
我已經試過wmode="transparent"技術,如看到的,但它似乎沒有工作。是否可以在divime視頻的頂部浮動一個div?

回答

4

你必須使用z-indexposition: absolute or relative;

Fiddle

1

你的div是視頻的母公司,因此是「下面」吧。如果您想在視頻浮動一個div,你會像這樣的東西

<div class="parent"> 
<iframe></iframe> 
<div class="floatedDiv"></div> 
</div> 

with this css 

.parent{position:relative;} 
iframe{position: relative;} 
.floatedDiv{position: absolute; z-index: 2;} 

,你還需要設置你的Flash對象

+0

感謝您指點我正確的方向! – 2014-09-23 10:19:08

0

的Wmode看來你過得更好剛剛有點困惑的問候你的Z-索引。試試這個...

<style> 
#wrap { 
    position: relative; 
    width: 400px; 
    height: 250px; 
    background-color: silver; 
} 

#video { 
    position: absolute; 
    z-index: 99999; 
} 
</style> 
<div id="wrap"> 
<div class="video">Something here I guess</div> 
<iframe id="video" src="http://player.vimeo.com/video/15888399" width="100%" height="100%" wmode="transparent" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen> 
</iframe> 
</div>