向右滚动时,div 停在屏幕左侧
我有一个关于 jQuery/css 的快速问题。我正在编写一个网站,并且有一个灰色框,其中包含内容/链接,当用户向右滚动时,我想将其粘贴到屏幕的左侧。我已经浏览了很多论坛/教程,但仍然找不到我的解决方案。这是该网站的链接。
我在 jQuery 方面是个新手,所以任何帮助将不胜感激,谢谢!
I have a quick jQuery/css question. I am coding a site and have a grey box that will have content/links inside of it that I want to stick to the left side of the screen when the user scrolls right. I've gone through a bunch of forums/tutorials but still can't find my solution. Here is a link to the site.
I'm rather a novice when it comes to jQuery so any help would be greatly appreciated, thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编辑:
这应该是您的文档准备脚本:
将其添加到您的 CSS:
并将 #sidebar 的 CSS 更改为:
并将侧边栏的 HTML 更改为:
EDIT:
This should be your document ready script:
Add this to your CSS:
And change the CSS for your #sidebar to:
And change the HTML for the sidebar to:
访问您的网页时,我收到此错误:
这不是 jQuery 函数。尝试scrollLeft()。
When visiting your webpage, I get this error:
That isn't a jQuery function. Try
scrollLeft()
.