滚动时我有一个侧边栏.现在我希望它在到达某个div时停止(并修复).
为了说明.
发生了什么:
http://postimg.org/image/l1n0djb0n/
我想要的是:
http://postimg.org/image/5evr05x8n/
我怎样才能做到这一点?
CSS:
#sidebar.affix-top { position: static; margin-top:0px; } #sidebar.affix { position: fixed; top:49px; }
HTML:
<div id="sidebar" class="sidebar_package"> info for sidebar <div class="hiddenpackage_c2a"> more content </div> </div>
JS:
//Side menu floater $('#sidebar').affix({ offset: { //top: $('header').height() top:185 } });