【发布时间】:2018-02-27 18:34:06
【问题描述】:
我在<p>标签中有一个带有h1和内容的页面,如下所示:
<h1>Content1</h1>
<p>Blablablalbal</p>
<h1>Content2</h1>
<p>Blablablalbal</p>
<h1>Content3</h1>
<p>Blablablalbal</p>
<h1>Content4</h1>
<p>Blablablalbal</p>
<h1>Content5</h1>
<p>Blablablalbal</p>
我想在右边实现Bootstrap Affix浮动,如Bootstrap官方页面:http://getbootstrap.com/javascript/#affix
但我不知道怎么做,我看不懂说明,我需要把这个:
<div data-spy="affix" data-offset-top="60" data-offset-bottom="200">
...
</div>
还有这个:
$('#my-affix').affix({
offset: {
top: 100
, bottom: function () {
return (this.bottom = $('.footer').outerHeight(true))
}
}
})
我该怎么办?
谢谢。
【问题讨论】:
-
两者都不需要,只能使用 HTML 标记。但是你需要把 ... 和
...
-
我需要在之间插入什么?
标签: javascript jquery html twitter-bootstrap bootstrap-affix