Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/3dtech/scrollarea
A vanilla JS scrollarea that supports touch, mouse and scrollwheel
https://github.com/3dtech/scrollarea
Last synced: 8 days 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 (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-11T12:58:12.000Z (2 months ago)
- Last Synced: 2024-09-11T18:19:43.430Z (2 months ago)
- Language: JavaScript
- Size: 95.7 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;
}
```