Iva*_*pić 5 html css jquery twitter-bootstrap
我的目标是侧边栏固定,它开始滚动很好,但当它接近页脚时,它开始闪烁.我做错了什么?看来,引导未定,并保持切换.affix-bottom上#sidebar
http://codepen.io/anon/pen/MJMQMr
JS
var $sidebar = jQuery('#sidebar');
jQuery($sidebar).affix({
offset: {
top: $sidebar.offset().top,
bottom: function() {
return (this.bottom = jQuery('#footer').outerHeight(true))
}
}
})
Run Code Online (Sandbox Code Playgroud)
CSS
.affix {
top: 0;
}
.affix-bottom {
position: absolute;
top: auto;
bottom: 20px;
}
Run Code Online (Sandbox Code Playgroud)
HTML
<div class="container">
<div class="header">
<!-- HEADER -->
</div>
<div class="row">
<div class="content col-md-8">
<!-- CONTENT -->
</div>
<div class="col-md-4">
<div id="sidebar">
<!-- AFFIXED -->
</div>
</div>
</div>
<div id="footer">
<!-- FOOTER -->
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
Nik*_*tov -1
我现在更新了我的代码检查:codepen.io
#sidebar.affix-bottom {
position: absolute;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
708 次 |
| 最近记录: |