In my application, where ever the scrollbar comes it should be changed to the custom scrollbar.Is there any way in css to style the scrollbar.If not,Please provide me any suggestions regarding the customizing the scrollbar.
I had seen the jquery plugins for the custom scrollbar,but I need to change the each place for the custom scrollbar .Instead,is there any way such that changing in one place should affect the all places where scrollbar will come in my application.
You can style the scrollbar in WebKit and older IEs.
To affect all scroll bars, you should be able to use a selector such as
body, textarea, .any-other-element-with-overflow-scroll
.Please consider the possible usability issues when using custom scroll bars.
I've developed a custom scrollbar library named SimpleScrollbar.
It does not depend on any other library/framework, and it's less than 1KB after gzip and minification.
It uses the native scroll, so there are no hacks, and the performance is awesome.
You only need to include the library in your page, and use the
ss-container
attribute in any div that you want to make scrollable. Live example:It works on all the modern browsers (Firefox, Chrome, Opera, Safari, Edge), and on IE10 and IE11. You can also use it in IE9 by including a classList polyfill.
All Android, iOS and Windows Phone browsers are supported either.
If you want to automatically find out all the elements that already have a scrollbar, you can do something like that: