如何在 safari/chrome 中将 div 的滚动条向左移动?
我有一个div,它的要求是将滚动条从右侧移动到左侧。我已经在 FF 和 IE 中通过 direction:rtl;
css 声明完成了这一点。 Safari 和 Chrome 似乎都忽略了这一点,仍然将滚动条放在右侧。有没有办法让它在 Safari 和 Chrome 中都位于左侧?谢谢!
(而且我无法说服参与此操作的人员像平常一样将滚动条放在右侧,所以我只需要一个解决方案将其放在左侧。)
I have a div and the requirement on it is to move the scrollbar from the right side to the left side. I've accomplished this in FF and IE with a direction:rtl;
css declaration. Safari and Chrome both seem to ignore this and still put the scrollbar on the right side. Is there a way to get it on the left side in both Safari and Chrome? Thanks!
(Also I cannot convince the people involved with this to have the scrollbar on the right side like it usually is, so I just need a solution to get it on the left.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用“虚拟”div 和几行 JavaScript 来代替像 jscrollpane 这样的成熟 JS 插件。我启动的这个 jsFiddle 显示了工作效果:
http://jsfiddle.net/rtceC/
但是,您可以,想要添加几行来在伪滚动内容 div 上注册滚轮事件,并相应地调整虚拟对象的滚动顶部(从而调整内容本身)。
In lieu of a full-fledged JS plugin like jscrollpane, you could achieve the desired effect with a 'dummy' div and a few lines of JavaScript. This jsFiddle I whipped up shows the working effect:
http://jsfiddle.net/rtceC/
You may, however, want to add a few lines to register a scroll wheel event over the pseudo-scrolling content div and adjust scrollTop for the dummy (and thereby for the content itself) accordingly.