0

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

I want a DIV without scrollbars. Yes — I know how overflow:hidden; works.

I want to scroll an overflowing DIV via JavaScript. I would also hide the overflow. But how to scroll the hidden content via JS?

Are there good JS examples, tutorials, API's or Libraries available?

Thanks, greets, J.

Community
  • 1
  • 1
Julian F. Weinert
  • 7,474
  • 7
  • 59
  • 107
  • 2
    i think this is the same question as http://stackoverflow.com/questions/1326570/how-to-disable-browser-or-element-scrollbar-but-allow-scrolling-with-wheel-or-a – boobiq Jan 12 '12 at 17:02
  • That's a much nicer way than my suggestion. I didn't know you could bind mousewheel events. – Reinstate Monica Cellio Jan 12 '12 at 17:09

1 Answers1

0

You could use Archer's solution above (div inside slightly smaller div to hide scrollbars) which is probably the simplest solution. Just for variety's sake though, you could also use a custom scrollbar plugin like tiny scrollbar and apply additional css to hide the scroll bars. That includes built-in mouse wheel support, and could also give you the option of horizontal scrolling if you needed it.

As a side note, is there anything on the page to indicate to the user that they are, in fact, able to scroll the content? Or are they suppose to figure it out on there own?

relic
  • 1,662
  • 1
  • 16
  • 24
  • I wanted to implement two bars, one at the top, one at the bottom of the div. When the user hovers these bars, the div should scroll itself. When I think about it, the DIV don't have to be scrollable. I just need a good JavaScript API for DIV content scrolling… – Julian F. Weinert Jan 12 '12 at 17:54
  • I found a cool script at: http://www.dynamicdrive.com/dynamicindex11/scrollc2.htm – Julian F. Weinert Jan 12 '12 at 18:59