Skip to content

Adds class "up" or "down" based on which way the user is scrolling.

Notifications You must be signed in to change notification settings

pellebjerkestrand/Skrulle

Repository files navigation

Skrulle

Adds class "up" or "down" based on which way the user is scrolling.

##jQuery Plugin

$(window).skrulle();

###Options

$(window).skrulle({
  selector: 'body', // The jQuery selector of the element that should get the classes.
  up: 'up',         // The class added when a user scrolls up.
  down: 'down'      // The class added when a user scrolls down.
});

##Vanilla For modern browsers.

Just include the file.

When a user scrolls up 'up' is added as a class to the document element.

When a user scrolls down 'down' is added as a class to the document element.

NB! The vanilla version uses

  • .addEventListener
  • .classList
  • .documentElement
  • .scrollY

About

Adds class "up" or "down" based on which way the user is scrolling.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published