[英]Disable window scrolling leaving the scrollbar visible
How can I disable window scrolling but leave scrollbar visible? 如何禁用窗口滚动但使滚动条可见?
I usually use overflow:hidden;
我通常使用
overflow:hidden;
. 。 But when I do that the window scrollbar disappears.
但是当我这样做时,窗口滚动条消失了。 I'm looking for a way to disable scrolling but keep the scrollbar visible.
我正在寻找一种禁用滚动但保持滚动条可见的方法。
Wrap your content in a div that has max-height:100% and overflow:hidden. 将您的内容包装在具有max-height:100%和overflow:hidden的div中。 Body tag needs the overflow:auto or overflow-y:scroll.
正文标签需要overflow:auto或overflow-y:scroll。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.