Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itmammoth/jquery.showuptrigger
A jQuery plugin that allows you to set a callback function when an element shows up.
https://github.com/itmammoth/jquery.showuptrigger
jquery jquery-plugin
Last synced: 3 months ago
JSON representation
A jQuery plugin that allows you to set a callback function when an element shows up.
- Host: GitHub
- URL: https://github.com/itmammoth/jquery.showuptrigger
- Owner: itmammoth
- Created: 2015-07-31T06:47:43.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-17T11:13:33.000Z (about 9 years ago)
- Last Synced: 2023-08-03T13:12:54.307Z (over 1 year ago)
- Topics: jquery, jquery-plugin
- Language: JavaScript
- Homepage:
- Size: 211 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jquery.showuptrigger
showuptrigger is a jQuery plugin that allows you to set a callback function when a particular element is showing up.
- Simple codebase (maybe too)
- Not too much options
- Adapted also for overflow elements## Usage
Include jquery.showuptrigger-*VERSION*.min.js after jQuery like below
``````
Then,
```
$('.scrollable-container').showuptrigger({
trigger: '#last-element',
callback: function() { alert('Welcome to the bottom!'); },
});
```## Methods
### $jqObj.showuptrigger('off')
You can stop a showuptrigger object from observing scroll event.
```
$container = $('.scrollable-container').showuptrigger({
trigger: '#last-element',
callback: function() { alert('Never called.'); },
});
...
...
$container.showuptrigger('off'); // Stop observing
```## Requirements
- Tested with jQuery 1.11.x## Contribution
Fork me, then ```$ npm install``` and ```$ npm start```## Changelog
#### Version 0.0.2
- Added 'off' method#### Version 0.0.1
- Initial version