Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swiftmade/stick-stack
A jquery plugin that helps stick elements consecutively
https://github.com/swiftmade/stick-stack
jquery sticky-elements
Last synced: about 2 months ago
JSON representation
A jquery plugin that helps stick elements consecutively
- Host: GitHub
- URL: https://github.com/swiftmade/stick-stack
- Owner: swiftmade
- Archived: true
- Created: 2017-02-01T22:00:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-02T00:14:32.000Z (almost 8 years ago)
- Last Synced: 2024-04-30T07:23:29.195Z (7 months ago)
- Topics: jquery, sticky-elements
- Language: HTML
- Size: 8.79 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
💚 Stick Stack
=============This is a slightly modified version of a jQuery plugin originally implemented by [@ilterocal](https://github.com/ilterocal).
# What does this plugin do?
It helps you stick a stack of elements (table headers, bootstrap panel headings, etc.) consecutively. **In only 75 lines.** As soon as the next sticky element arrives, the previous sticky element is released. Here is a demo:![Demo](https://media.giphy.com/media/26xBMFekYTMCRAxHy/giphy.gif)
# How to use?
Just include src/stick-stack.js in your code and specify which elements you want to stick-stack like so:
$(window).stickStack('.panel-heading');
Insert appropriate selector as the parameter.
# Customize
Instead of a selector, you can also pass an options object. Every possible option is listed below. The **el** key is compulsory in this mode, which should be the selector for stickable elements.
$(window).stickStack({
top: 0,
margin: 0,
zIndex: 10,
el: '.selector',
containerSelector: null
});If containerSelector is null, measurements will be done based on stackable div's immediate parent. If you pass in a selector, stick stack will find the closest match and use its height in calculating whether or not to hide the current sticky div.