https://github.com/3dtech/scrollarea
A vanilla JS scrollarea that supports touch, mouse and scrollwheel
https://github.com/3dtech/scrollarea
Last synced: 5 months ago
JSON representation
A vanilla JS scrollarea that supports touch, mouse and scrollwheel
- Host: GitHub
- URL: https://github.com/3dtech/scrollarea
- Owner: 3dtech
- License: mit
- Created: 2021-11-29T07:03:51.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-17T10:33:35.000Z (6 months ago)
- Last Synced: 2025-01-17T11:22:20.069Z (6 months ago)
- Language: JavaScript
- Size: 149 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scrollarea
A vanilla JS scrollarea that supports touch, mouse and scrollwheel# Usage
```js
let area = document.getElementById("scrollarea");
let sa = new ScrollArea(area);```
# CSS
Make the container fixed height, overflow hidden. And the scrollable container as big as needed.
To show a scrollbar add some styles to```css
.sa-content-longer .sa-scrollbar {
width: 1em;
background-color: lightblue;
}.sa-content-longer .sa-bar {
width: 1em;
background-color: antiquewhite;
}
```