Fires an event when the user reaches a certain boundary.
This Plugin is part of MooTools PowerTools!.
Build via Packager, requires MooTools Core and MooTools Class-Extras to be registered to Packager already
packager register /path/to/scroll-loader
packager build ScrollLoader/* > scroll-loader.js
To build this plugin without external dependencies use
packager build ScrollLoader/* +use-only ScrollLoader > scroll-loader.js
See Demos/index.html
You can create an instance of ScrollLoader via the following code
new ScrollLoader({
onScroll: function(){
// User has reached a certain boundary
// Let's make a Request for new content
this.detach(); // While waiting, we detach the listener so the event does not fire accidentally
var scroll = this; // Save a reference
new Request(url, {
onSuccess: function(text){
new Element('div', {text: text}).inject(myElement); // Add the new content
scroll.attach(); // Attach the event again so the event fires when you hit the bottom again
}
}).get();
}
});
Configurable Options / Events
Options
Events
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4