隐藏滚动条,但保持滚动的原生感觉
这是我的意思的一个例子: http://screencast.com/t/Roi3HJtHyH 当长点击条目后内容向左移动,这个效果看起来有点难看。
I've searched for an answer to this question and came across
hide 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
只是为了完整起见,为了回答您的问题,这里是没有滚动条的可滚动页面。
请注意,这不是首选,而且我也会强制滚动条,因为 Lobello 已经回答了。
Just for completeness sake, to answer your question, here is the scrollable page without scrollbar.
Note that this is not preferred, and I would also force the scrollbar as Lobello already answered.
这是标准的浏览器行为。
取消滚动条会降低用户友好性。
您可以使用 css 将滚动条设置为始终可见。
CSS:
That is standard browser behavior.
Taking away scrollbar reduces user-friendliness.
You can set scrollbar to stay visible all the time with css.
CSS:
如果你确实想禁用滚动(在框架集中,滚动最糟糕的地方),那么使用scrolling=no。
If you really want to disable the scrolling (In a frameset, the worst possible place for scrolling) then use scrolling=no.
这对我有用:
This works for me: