强制滚动条容纳固定元素
我正在使用 jquery simplemodal 插件,
现在我已经对其进行了设置,以便它根据其中的内容使用动态高度。
但是我在这里遇到了一些障碍,似乎如果我使浏览器窗口变小,它就无法适应 simplemodal 元素的高度,因此容器内的某些内容会隐藏在屏幕外。
我尝试添加:
body {
overflow: auto;
}
但这没有任何效果。事实上,当根据页面内容而不是简单模式元素高度调整大小时,主体会滚动。
如果固定元素溢出,有没有办法强制滚动条?
i am using the jquery simplemodal plugin,
now i've set it up so that it uses a dynamic height, based on the content within it.
however i've run into a bit of a snag here, it seems that if i make the browser window smaller, it does not accomodate for the height of the simplemodal element, therefore some things within the container are hidden off-screen.
i've tried adding:
body {
overflow: auto;
}
and this accomplishes nothing. in fact, the body will scroll when resized based on the content of the page, not the simplemodal element height.
is there a way for me to force scrollbars if a fixed element is overflowing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这会强制滚动条出现,即使不需要。
This forces scrollbars to appear, even when not needed.
溢出:滚动;
如果您只想显示一个实例,请将其放入一个可以链接到 simplemodal 元素的类中。
overflow:scroll;
if you only want it to show for an instance(s), put that in a class you can chain to your simplemodal element.