溢出 Div 中的偏移问题
当在具有固定高度和溢出的 div 内部使用 JQuery Offset 时,我遇到了问题。
在这个 div 中,我有两列,一个主栏和一个侧栏。我希望侧栏中的一个 div 在 div 内滚动,直到到达顶部,但随后我希望它保留在那里。
我在这里设置了一个演示: http://jsfiddle.net/zsJAr/53/
确实向上滚动,但它不会开始停留在顶部,直到滚动超过 div 的顶部,从而有效地切断了 div 的顶部。
任何帮助将不胜感激。
I'm having problems with JQuery Offset when used inside of a div that has a fixed height and overflow.
Inside this div I have two columns, a main and a sidebar. I want one of the divs in the side bar to scroll within the div until it reaches the top, but then I want it to stay there.
I have a demo set up here : http://jsfiddle.net/zsJAr/53/
The div does scroll up but it doesn't start to stay at the top until it's scrolled past the top of the div, effectively cutting off the top part of the div.
Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
您需要
所在位置的顶部偏移量:
http://jsfiddle。网/manianator/qaVnY/
You needed the top offset where the
<h1>
is:http://jsfiddle.net/maniator/qaVnY/