侧边栏比浏览器窗口高,侧边栏在向下滚动时会附着在页面的底部,在向上滚动时会附着在页面的顶部。
侧边栏比页面的高度小,侧边栏在页面向上或向下滚动时都会附着在页面的顶部。
Nice example showing multiple stickies on one page.
Use innerSticker
option to stick at a certain element. In this example, sticky will stick to the second box inside the sidebar only when you go up. When you go down it sticks to the bottom of the sidebar.
Use innerSticker
option to stick at a certain element, and followScroll:false
so the sidebar doesn't follow the scroll once attached. In this example, sticky will stick to the second box inside the sidebar when you go down or up.
Use innerTop
option to stick after a certain distance, and followScroll:false
so the sidebar doesn't follow the scroll once attached. In this example, sticky will stick 200px from top inside the sidebar when you go down or up.