Skip to content

trumpdo197/custom-sticky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Sticky

Terry Do ([email protected])

Overview

Custom Sticky is small, free open-source plugin which helps you in making sidebar sticks on scrolling and stay where it is instead of returning its original position when unsticking. This is mainly used for sticky sidebars.

Usage

$("#yoursidebar").customSticky();

Options

road
Define the scroll path's length that the sidebar'd be fixed. Default: 1000 (px).
destroy
Destroy the plugin. Default: false.
unstickBefore (jQuery Object)
Don't use along with road. Your sidebar will stop being fixed before this element's top border. Default: NULL.
offsetTop, offsetBottom, offsetLeft, offsetRight
Positioning the sidebar after being fixed. Default: 0;

Some Examples

// Unstick and stay where it is after scrolling 2000px.
$("#yoursidebar").customSticky({
	road: 2000,
})

// Unstick and stay where it is after scrolling to the top of an element.
$("#yoursidebar").customSticky({
	unstickBefore: $('#div'),
})

// Rekt it!
$("#yoursidebar").customSticky({
	destroy: true,
})

Compatibility

  • Jquery v1.7.1 or above is required.

Licenses

  • MIT License

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published