Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.
/ scrollClass Public archive

jQuery plugin that adds specified classes to an element based on scroll behavior.

Notifications You must be signed in to change notification settings

lstellway/scrollClass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scrollClass

jQuery plugin that adds specified classes to an element based on scroll behavior.

Install with Bower

bower install --save scrollClass

Usage

Include jQuery

<script type="text/javascript" src="//code.jquery.com/jquery-3.0.0.min.js"></script>

Include scrollClass

<script type="text/javascript" src="./dist/scrollClass.min.js"></script>

Options

  • target (jQuery Object) [Default: $(this)]
    • The targeted element to change classes.
  • offset (number | function) [Default 100]
    • number - The number of pixels offset from the top of the document that determines when the CSS class passed in the class option will be toggled.
    • function - A function that returns a number value representing the number of pixels offset from the top of the document that determines when the CSS class passed in the class option will be toggled.
  • downClass (string) [Default "progressing"]
    • The class toggled on to the target element when the user is scrolling downward.
  • upClass (string) [Default "regressing"]
    • The class toggled on to the target element when the user is scrolling upward.

About

jQuery plugin that adds specified classes to an element based on scroll behavior.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages