如何创建 scribd 导航栏棒效果
使用 jquery.waypoints 插件,您可以轻松创建粘性元素。它的粘性元素演示显示了一个导航栏,默认情况下位于稍低于页面顶部,然后具有以下行为: a)当用户向下滚动并且导航栏到达视口顶部时,它会粘在那里 b) 当用户向上滚动回到页面顶部时,导航栏返回到其正常位置。
我正在尝试做一些类似但有些相反的事情,这与 scribd 导航栏的效果完全相同。从此抄写页面的最底部开始,慢慢向上滚动以查看的效果。
这是怎么做到的?我假设航路点会促进它。谢谢。
With the jquery.waypoints plugin you can easily create sticky elements. Its sticky elements demo shows a navbar that is by default positioned a little below the top of the page, then with following behaviour:
a) as the user scrolls down and the navbar hits the top of the viewport it sticks there
b) when the user scrolls back up to the top of the page the navbar returns to its normal position.
I'm trying to do something similar but somewhat reversed, which is the exact same effect as the scribd navbar. Start from the very bottom of this scribd page and scroll up slowly to see the effect.
How is this done? I'm assuming waypoints would facilitate it. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我找到的解决方案,但仍然对其他实现感兴趣。
js:
CSS:
Here's a solution I figured out, but still interested in other implementations.
js:
css: