A nice and lightweight scrollbar.
- Cross browser
- Lightweight
- Nice looking
- Customize
- No jQuery dependency
$ bower install nice-bar --save
$ npm install nice-bar --save
<link rel="stylesheet" href="bower_components/nice-bar/dist/css/nice-bar.min.css" />
<script src="bower_components/nice-bar/dist/js/nice-bar.js"></script>
<style>
.container {
height: 500px; /* height is the only css property required */
/* height: 100%; work also*/
}
</style>
<div id="container" class="container">
<!--content-->
</div>
niceBar.init(document.getElementById('#container'));
// set theme
niceBar.init(document.getElementById('#container'), {theme: 'dark'});
You can custom scrollbar style with CSS easily:
.nice-bar .nice-bar-slider-y {
background: #222;
/* whatever */
}
- IE8+
- Firefox
- Chrome
- Safari
- Opera