在 jQuery 中禁用窗口滚动
我正在使用诸如 facebox 之类的东西,并且希望禁用主窗口滚动条。 但有一点需要注意的是,facebox 组件内部有一个滚动条,它需要能够滚动。
我试图修复的是以下情况:
当滚动内部滚动元素(在facebox内部)时,当滚动结束时,它会进一步向下滚动页面。
I am using something like facebox, and want the main window scrolling bar to be disabled.
One catch though, There is a scroll bar inside the facebox component, which needs to be able to scroll.
What I am trying to fix is the following case:
when scrolling the internal scrolling element (inside facebox), when scroll ends, it scrolls the page down further.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 css 中执行此操作:
这将隐藏主窗口中的滚动条
do it in css:
this would hide the scrollbar in the main window
我进入facebox.js文件并
添加
$('body').css('overflow', '');到文档末尾
这会在打开时停止滚动,关闭时将滚动放回原处,它对我有用 http://www.vestedutility.com.au/home_electrical_saftey_check.php
i went into the facebox.js file and added
to
and added $('body').css('overflow', ''); to the end of the document
This stops the scroll when open and when closed put the scroll back in, it worked for me at http://www.vestedutility.com.au/home_electrical_saftey_check.php