0
我有兩個可變寬度的容器元素。Sticky.js在位置變爲「固定」時更改DIV的寬度
http://maxwellrushton.com/buy-in-bleed-out/
在他們中的一個,右一個(目前爲黑色,以保持它明顯)有一個視頻。它目前是其父母寬度的100%。
<div id="buy-in-video-container" class="container">
<iframe class="buy-now-iframe" width="500" height="281" src="//www.youtube.com/embed/mYNWY4tRWOo" frameborder="0" allowfullscreen></iframe>
</div><!-- /#buy-invideo-container-->
有:
.page-id-511 #buy-in-video-container{
display: inline-block;
width: 40%;
margin: 0 2.5% 0 2.5%;
height: 100px;
background-color: #000;
position: relative;
margin-top: 100px;
height: 100%;
overflow: hidden;
height: 1000px;
}
.buy-now-iframe{
width: inherit;
z-index: 1200;
position: relative;
}
我使用Sticky.js舉行的地方視頻時,它從頂部200像素,因爲我的客戶希望它永遠是在屏幕上。
我不能指定寬度,因爲它變化,但我也不能指定位置,因爲它也不同。
我究竟如何對此進行排序,還是必須指定鏈上的寬度,然後在一堆媒體查詢語句中失去響應性?