Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/attitude/scrolltriggers.js
Minimalistic scrolling vanilla JS plugin
https://github.com/attitude/scrolltriggers.js
Last synced: about 6 hours ago
JSON representation
Minimalistic scrolling vanilla JS plugin
- Host: GitHub
- URL: https://github.com/attitude/scrolltriggers.js
- Owner: attitude
- License: mit
- Created: 2016-08-18T10:52:53.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2023-11-14T13:02:26.000Z (about 1 year ago)
- Last Synced: 2023-11-14T14:26:07.023Z (about 1 year ago)
- Language: HTML
- Homepage: https://attitude.github.io/scrollTriggers.js/
- Size: 1.34 MB
- Stars: 6
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scrollTriggers.js
Minimalistic scrolling vanilla JS plugin, zero dependency < 2KB minified.
[See demo](http://attitude.github.io/scrollTriggers.js)
## Options
- `el` - `Element` or `string` (element id)
- `before`, `during`, `after` - `[object Function]` callback
- `origin` – `float` from `0` to `1`, default: `0.5`,
where 0 = top of the screen, 1 = bottom of the screen## Usage
Link the script file and initialize the elements to watch;
```js
window.addScrollingTriggers([{
el: 'section-with-some-specific-id',
before: function() {
App.api.navigationVisible(true);
},
during: function () {
App.api.navigationVisible(true);
},
after: function () {
App.api.navigationVisible(false);
},
origin: 1
}]);
```## About
Works with modern browsers, pull requests are welcome.