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

scrolldir

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scrolldir - npm Package Compare versions

Comparing version 0.0.4 to 1.1.2

2

package.json
{
"name": "scrolldir",
"version": "0.0.4",
"version": "1.1.2",
"description": "Prefectly track user scroll direction without the jitter",

@@ -5,0 +5,0 @@ "main": "dist/scrolldir.min.js",

<figure align="center">
<img alt="scrolldir banner" src="https://cloud.githubusercontent.com/assets/1074042/22093384/09f3c2a6-ddba-11e6-8706-7e63be185448.jpg" />
</figure>
<p align="center">Prefectly describes vertical scroll direction without the jitter</p>
<p align="center">Perfectly describes vertical scroll direction without the jitter</p>

@@ -25,13 +25,13 @@ <hr>

<h1 align="center">ScrollDir 🔺||🔻</h1>
<h1 align="center">ScrollDir ⬆⬇</h1>
_ScrollDir_ is a micro Javascript library that perfectly describes vertical scroll direction in a html data attribute. From there, do what want.&nbsp;💪
_ScrollDir_ is a micro Javascript library that perfectly describes vertical scroll direction in an HTML data attribute. From there, do what want.&nbsp;💪
### ScrollDir is perfect for:
- showing or hiding sticky elements based on scroll direction.
- tracking events on scroll direction
- **ignoring small scroll movements** that cause unwanted element jitters.
- Scrolldir will only change direction when the user scrolls a significant vertical amount.
- showing or hiding sticky elements based on scroll direction 🐥
- tracking events on scroll direction 🔬
- only changing its direction attribute when scrolled a significant amount 🔥
- **ignoring small scroll movements** that cause unwanted jitters 😎
## Installing from a package manager 🌴
## Install 📦

@@ -51,12 +51,13 @@ npm

## Setup
## Setup 📤
Add **dist/scrolldir.min.js**.
## Basic Usage
## Usage 🛠
```javascript
scrollDir();
```
By default ScrollDir will set the `data-scrolldir` attribute on the `<html>` element to `up` or `down`:
By default, ScrollDir will set the `data-scrolldir` attribute on the `<html>` element to `up` or `down`:

@@ -71,3 +72,3 @@ ```html

You can then change your styling based on vertical scroll direction.
Now it's easy to change styling for vertical scroll direction!

@@ -78,3 +79,3 @@ ```css

## Options
## Options ⚗

@@ -81,0 +82,0 @@ To use an attribute besides `data-scrolldir`:

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