Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lemehovskiy/scroller

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lemehovskiy/scroller

VannilaJS plugin for detecting vertical scroll progress

  • 0.2.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

scroller

Status GitHub Issues GitHub Pull Requests License


VanillaJS plugin for detecting vertical scroll progress.

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;
}

Keywords

FAQs

Package last updated on 15 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc