Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
70
rated 0 times [  72] [ 2]  / answers: 1 / hits: 61192  / 14 Years ago, tue, july 20, 2010, 12:00:00

Possible Duplicate:

How to disable browser or element scrollbar, but allow scrolling with wheel or arrow keys?






I want to know if it is possible to hide the scrollbar, while scrolling is still enabled with mouse/keyboard.



I tried to use CSS: overflow: hidden;. The effect is scrollbar disabled and scrolling disabled.


More From » jquery

 Answers
29

For future reference there is also a solution without jQuery - just have the wrapper div style contain overflow:hidden and use this JavaScript two-liner:


// get the width of the textarea minus scrollbar
var textareaWidth = document.getElementById("textarea").scrollWidth;

// width of our wrapper equals width of the inner part of the textarea
document.getElementById("wrapper").style.width = textareaWidth + "px";

Update: you can use the same principle to create scrollable div without scrollbar.


[#96164] Sunday, July 18, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
luna

Total Points: 698
Total Questions: 114
Total Answers: 93

Location: Israel
Member since Wed, Apr 14, 2021
3 Years ago
luna questions
;