Get started with overlayscrollbars CDN

MIT licensed

The Overlayscrollbars library enhances the scrolling experience by adding custom scrollbars to elements.

Tags:
  • overlayscrollbars
  • custom
  • scrollbar
  • scrollbars
  • scroll
  • frontend

Stable version

Copied!

How to start using overlayscrollbars CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with overlayscrollbars CDN - cdnhub.io</title>
  <style>
    #container {
      height: 800px;
      width: 100%;
      overflow: auto;
    }
  </style>
  <script src="https://cdn.jsdelivr.net/npm/@alpinejs/[email protected]/dist/alpine.min.js" defer></script>
  <script src="https://cdn.cdnhub.io/overlayscrollbars/2.6.1/browser/overlayscrollbars.browser.es6.min.js" defer></script>
  <script>
    document.addEventListener('alpine:init', () => {
      Alpine.data('app', () => ({
        init() {
          this.scrollbar = new OverlayScrollbars('#container');
        },
      }));
    });
  </script>
</head>
<body x-data="{ init: app => app.init() }" x-init="init()">
  <div id="container">
    <button>Scroll to bottom</button>
    <ul>
      <li v-for="i in 100">Item {{ i }}</li>
    </ul>
  </div>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions