出现滚动条并导致页面跳转
我有一个 JQuery 动画,可以扩展 DIV 并使其比浏览器更大。当发生这种情况时,会出现一个滚动条,并使页面看起来好像在跳跃。有人对此有任何解决方案吗?
I have aJQuery animation that expands a DIV and makes it go larger than the browser. When that happens a scroll bar appears and meks the page look as if it jumps. Anyone have any solutions for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
请参阅:使主滚动条始终可见。
See: Making the main scrollbar always visible.
如果您知道需要溢出,请在 CSS 中将其打开
If you know you will need need the overflow then turn it on in CSS
我猜页面看起来像是“跳跃”的,因为当内容低于浏览器底部时,垂直滚动条会动态添加到窗口中。
您可以通过将 HTML 标签的高度设置为 101% 来使垂直滚动条始终显示,无论是否有内容:
I guessing that the page looks like it 'jumps' because the vertical scroll bar is dynamically added to the window when the content goes below the bottom of the browser.
You can make the vertical scroll bar always appear regardless whether or not there is content by setting the height of your HTML tag to 101%:
如果页面不应该滚动,您可以在 body 标记上设置overflow:hidden。另外,您可以设置左侧的装订线宽度恒定。
If the page is never supposed to scroll, you can set overflow: hidden on the body tag. Also, you might set make the gutters on the left side constant width.
您可以在 body 元素上执行“overflow-y:hidden”,它将禁用滚动条
You can do "overflow-y:hidden" on the body element and it will disable scrollbar