JSFiddle - React, Tailwind, and code Playground
by Sachin Patel
HTML
<script src="http://gromo.github.io/jquery.scrollbar/jquery.scrollbar.js"></script>
<div style="height:60px; width:200px: overflow-y:hidden">
<div class="scrollbar_content scrollbar-inner">
<div class="box"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box2"></div>
<div class="box3"></div>
</div>
</div>
CSS
.scrollbar_content {
height:100%;
width:100%;
}
.box {
display:inline-block;
margin:2px;
background:red;
height:50px;
width:50px;
}
.box2 {
display:inline-block;
margin:2px;
background:yellow;
height:50px;
width:50px;
}
.box3 {
display:inline-block;
margin:2px;
background:blue;
height:50px;
width:50px;
}
/*************** SCROLLBAR BASE CSS ***************/
.scroll-wrapper {
overflow: hidden !important;
padding: 0 !important;
position: relative;
}
.scroll-wrapper > .scroll-content {
border: none !important;
box-sizing: content-box !important;
height: auto;
left: 0;
margin: 0;
max-height: none;
max-width: none !important;
overflow: scroll !important;
padding: 0;
position: relative !important;
top: 0;
width: auto !important;
}
.scroll-wrapper > .scroll-content::-webkit-scrollbar {
height: 0;
width: 0;
}
.scroll-element {
display: none;
}
.scroll-element, .scroll-element div {
box-sizing: content-box;
}
.scroll-element.scroll-x.scroll-scrollx_visible,
.scroll-element.scroll-y.scroll-scrolly_visible {
display: block;
}
.scroll-element .scroll-bar,
.scroll-element .scroll-arrow {
cursor: default;
}
.scroll-textarea {
border: 1px solid #cccccc;
border-top-color: #999999;
}
.scroll-textarea > .scroll-content {
overflow: hidden !important;
}
.scroll-textarea > .scroll-content > textarea {
border: none !important;
box-sizing: border-box;
height: 100% !important;
margin: 0;
max-height: none !important;
max-width: none !important;
overflow: scroll !important;
outline: none;
padding: 2px;
position: relative !important;
top: 0;
width: 100% !important;
}
.scroll-textarea > .scroll-content > textarea::-webkit-scrollbar {
height: 0;
width: 0;
}
/*************** SIMPLE INNER SCROLLBAR ***************/
.scrollbar-inner > .scroll-element,
.scrollbar-inner > .scroll-element div
{
...
JavaScript
$('.scrollbar_content').scrollbar();