0.2.7 • Published 5 months ago

@lemehovskiy/scroller v0.2.7

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Status GitHub Issues GitHub Pull Requests License


Demo

Basic demo Auto adjust scroll offset demo

🧐 About

VanillaJS plugin for detecting vertical scroll progress.

🏁 Getting Started

Installing

npm i @lemehovskiy/scroller

Scroller example

index.js

import Scroller from "@lemehovskiy/scroller";

const scroller = new Scroller(document.querySelector(".scroller-element"), {
  autoAdjustScrollOffset: true,
});
const progressEl = document.getElementById("progress");

if (progressEl) {
  scroller.progressChanged.on((progress) => {
    progressEl.innerHTML = "" + progress;
  });
}

index.html

<div id="progress"></div>
<div class="spacer"></div>
<div class="scroller-element"></div>
<div class="spacer"></div>

style.css

.spacer {
  min-height: 500px;
  background-color: aquamarine;
}
.scroller-element {
  min-height: 700px;
  background-color: azure;
}
#progress {
  position: fixed;
  top: 0;
  left: 0;
}
0.2.7

5 months ago

0.2.6

5 months ago

0.2.5

5 months ago

0.2.3

5 months ago

0.2.4

5 months ago

0.2.1

5 months ago

0.2.0

5 months ago

0.2.2

5 months ago

0.0.1

2 years ago