问题描述
我搜索过这个问题的答案,遇到了
,但是jQuery插件不能做我想做的。一个,滚动感觉有点马虎和不可控制。
我需要这个的原因很简单:当你展开一些项目时,我的页面会有点长,滚动条出现在侧面,使一切向左移动。我想有一种方法来避免这一点,通过或者能够保持滚动条在任何时候都可见,或者完全隐藏它,但仍保持本机能力滚动。
I've searched for an answer to this question and came acrosshide scrollbar while still able to scroll with mouse/keyboard but the jQuery plugin doesn't quite do what I'd like to do. For one, the scrolling feels a bit sloppy and uncontrollable.The reason why I need this is simple: my page gets a little longer when you expand some items and the scrollbar appears out of the side and makes everything move to the left. I'd like to have a way to avoid this, by either being able to keep the scrollbar visible at all times or hiding it completely but still keep the native ability to scroll.
以下是我的意思示例:
Here's an example of what I mean: http://screencast.com/t/Roi3HJtHyH when the long entry is clicked the content moves to the left, and this effect looks a little ugly.
推荐答案
这是标准的浏览器行为。
That is standard browser behavior.
取走滚动条会降低用户友好性。
Taking away scrollbar reduces user-friendliness.
CSS:
body {
overflow-y: scroll;
}
这篇关于隐藏滚动条,但保持滚动与本机的感觉的能力的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!