【发布时间】:2016-05-15 08:57:11
【问题描述】:
当用户滚动时,如何设置上部 div 固定以使下部 div 越过他?我不知道图像的高度是多少。 http://codepen.io/anon/pen/oxOPXv
// Stays in position
<div class="col-md-12 top-wrapper">
<div class="container image-wrapper">
<img src="http://placehold.it/750x550" />
</div>
</div>
// moving up and over .top-wrapper (also other content below this)
<div class="bottom-wrapper">
<div class="container">
<div class="col-md-3 sidebar">
<p>Lorem</p>
</div>
<div class="col-md-9 main-div">
<p>Lorem</p>
</div>
</div>
</div>
【问题讨论】:
-
不确定所有引导程序的可能性,但是,因为你有 jQuery,并且图像高度是动态的......这(也许)可能会有所帮助:codepen.io/anon/pen/oxOPBg