Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaxgeller/bouncer.js
https://github.com/jaxgeller/bouncer.js
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jaxgeller/bouncer.js
- Owner: jaxgeller
- Created: 2015-09-11T23:36:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-16T02:44:35.000Z (over 9 years ago)
- Last Synced: 2023-09-19T18:47:03.915Z (over 1 year ago)
- Language: JavaScript
- Size: 160 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bouncer.js
Lets you know when elements are in view. It's fast.
### How to use
```javascript
var opts = {
selector: document.querySelectorAll('.elementOrElementstoCheck'),
offset: '100px'
fireOnce: false
}var b = new Bouncer(opts, function(direction) {
alert(direction);
});
```### Why not waypoints.js?
* Bouncer supports multiple selectors at the same time.
* Alerts both entering selectors, and while in selectors.
* More lightweight.
* Written in vanilla javascript; supports everything.### Defaults
```javascript
var opts = {
selector: null,
offset: 0
fireOnce: false
}
```