https://github.com/usablica/kissui.sticky
Simple and lightweight sticky position that works everywhere
https://github.com/usablica/kissui.sticky
Last synced: 9 months ago
JSON representation
Simple and lightweight sticky position that works everywhere
- Host: GitHub
- URL: https://github.com/usablica/kissui.sticky
- Owner: usablica
- License: mit
- Created: 2016-08-15T17:19:34.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-10-16T11:38:34.000Z (almost 9 years ago)
- Last Synced: 2025-06-27T08:41:59.787Z (about 1 year ago)
- Language: CSS
- Homepage: http://sticky.kissui.io
- Size: 34.2 KB
- Stars: 11
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kissui.sticky
> Simple and lightweight sticky position that works everywhere.
Keeps elements positioned as "fixed" or "relative" depending on how it appears in the viewport. As a result the element is "stuck" when necessary while scrolling.
## Install
You can use *NPM* or *Bower* or *download the package manually*.
## Getting Started
Using this libarary is as easy as adding `data-kui-sticky` attribute to your elements:
```html
Hello world!
```
That's it.
## Advanced
You can use the API to add an element:
```js
kissuiSticky.add(element, {
'className': 'custom_class',
});
```
If you need more help, explore `/example` in the repo.
## Example
You can simply add the `data-kui-sticky` attribute to any elements and that's it:
```html
```
Or if you want to add a custom CSS class after activating the sticky position, use this:
```html
```

## Author
Afshin Mehrabani
## License
MIT