HTML element scrollbar on the left [duplicate]

跟風遠走 提交于 2020-02-02 13:34:25

问题


Possible Duplicate:
DIV Vertical Scroll bar on left

is there a way with css or js to show the scrollbar of an element on the left instead of on the right? i don't need a crossbrowser way i need it only on Firefox.


回答1:


If you want the direction to be left-to-right, but still want to violate every expectation a user has to scrollbars, then you can hack it using javascript.
Simply create a 1px wide div on the left side of your content. Have it be the same height as the content which you want to scroll. Then hook up an onscroll event to that div and whenever the user scrolls that div, you can scroll the content area manually.

Some further tips: main content area needs to have overflow:hidden and you can use negative values for margin-top to fake the scrolling.




回答2:


Try

<textarea dir="rtl">

or

<body dir="rtl"> 

or

<html dir="rtl">


来源:https://stackoverflow.com/questions/2772347/html-element-scrollbar-on-the-left

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!