8000 GitHub - SMCreativeAB/sticky.js: Super small (just 0.1KB) jQuery plugin to add a class when scrolling past a certain point. Useful for triggering sticky elements.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Super small (just 0.1KB) jQuery plugin to add a class when scrolling past a certain point. Useful for triggering sticky elements.

License

Notifications You must be signed in to change notification settings

SMCreativeAB/sticky.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sticky.js

Super small (just 0.1KB) jQuery plugin to add a class when scrolling past a certain point.

Installation

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

Usage

Add the class my-class to the element with id my-element when the visitor scrolls past 50px from the page top. The class will automatically be removed when scrolling back past the trigger.

$('#my-element').sticky(50, 'my-class');

Same as above, but triggered when the element is about to be scrolled past.

var elementY = $('#my-element').offset().top;
$('#my-element').sticky(elementY, 'my-class');

About

Super small (just 0.1KB) jQuery plugin to add a class when scrolling past a certain point. Useful for triggering sticky elements.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0