Responsive Custom Scrollbar For Overflowing Content – exScroll

Category: Javascript | April 25, 2023
Views Total:98 views
Official Page:Go to website
Last Update:April 25, 2023


Responsive Custom Scrollbar For Overflowing Content – exScroll


exScroll is a JavaScript library that attaches a responsive, customizable scrollbar to the container whose inner content is overflowed.

How to use it:

1. Insert the stylesheet exscroll.css and JavaScript exscroll.js into the document.

<link rel="stylesheet" href="./dist/exscroll.css" />
<script src="./dist/exScroll.js"></script>

2. Add the scrollbar to the container.

<div exscroll>
  <div exscroll-content>Inner Content</div>
  <div exscroll-scrollbar></div>

3. Initialize the exScroll and done.

let scroller = new exScroll();

4. Override the default selectors.

<div class="wrapper">
  <div class="content">
    <div class="inner"></div>
  <div class="scrollbar"></div>
let scroller = new exScroll({
    wrapperName: ".wrapper",
    contentName: ".content",
    scrollerName: ".scrollbar",

5. Override the default styles of the scrollbar.

.exscroll-scrollbar {
  box-sizing: border-box;
  margin-top: 20px;
  width: calc(100% - 100px);
  margin-left: 50px;
  height: 12px;
  padding: 2px;
  border-radius: 9999px;
  background-color: #fff;
  border: 1px solid #aaa;
  position: relative;
.exscroll-dragger {
  display: block;
  width: 40px;
  height: 100%;
  background-color: #aaa;
  border-radius: 9999px;
  position: absolute;
  top: 0;
  cursor: pointer;


v1.2.0 (04/25/2023)

  • Bugfix

You Might Be Interested In:

Leave a Reply