Reputation: 9645
I'm developing a small custom scrollbar plugin.
Everything is okay, but how do I hide the scrollbar?
I don't want to wrap it all in another element. Another idea was to lay custom bar over native one, but native scrollbars have different width in different OS's, correct?
How would you got rid of native scrollbar?
Upvotes: 1
Views: 448
Reputation: 3346
The only way I can think of, that would work in all browsers would be to wrap all the content in one div, that would be scrollable. Then set the overflow property of the body or html to hidden.
The wrapped div should have its height adjusted to that of the window, and the width about 50px more, that way it's scrollbar would be hidden from view, but you would still be able to scroll up and down.
Upvotes: 1