Skip to content
No description or website provided.
JavaScript CSS
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
sample
.gitignore
LICENSE
README.md
bower.json
zscroll.js
zscroll.min.js

README.md

zscroll.js

zscroll.js is a lightweight JavaScript library for one single purpose - fire zscroll events with the scrolling direction once a page is scrolled

Usage

You can get this script either from this repository or by running

bower install zscroll-js

To activate events with the scrolling directions in your page, simply include the library file - it will register all events automatically.

<script src="zscroll.min.js"></script>

Then, start listening for the events:

document.addEventListener('zscroll', function (e) {
    console.log(e.detail.direction);
}, false);

The e.detail object contains the following attributes:

{
    direction: string // One of those: up, down, left, right
}
Something went wrong with that request. Please try again.