引以以下js
<script src="//code.jquery.com/jquery-3.1.1.min.js"></script> <script src="js/jquery.stacked-strips.js"></script>
为您的网页创建一组内容部分。请注意,堆叠的条插件需要多个内容部分才能工作。
<section> Content 1 </section> <section> Content 2 </section> <section> Content 3 </section>
将以下所示的所需CSS样式添加到您的网页。
.fixed {
position:fixed;
top:0;
left:0;
width:100%;
}
.unfixed {
position:relative;
width:100%;
}活动的堆叠滚动 ING影响使用默认选项。
$('section').stacked_strips({
// start position in pixels.
active_position: 50,
// or a pixel value
strip_size:'full',
// add a class to the previous section
after_class:false
});