https://github.com/thinkphp/scroll-loader
Loads more content when a user reaches the end of the page using the incredible MooTools.
https://github.com/thinkphp/scroll-loader
Last synced: 3 months ago
JSON representation
Loads more content when a user reaches the end of the page using the incredible MooTools.
- Host: GitHub
- URL: https://github.com/thinkphp/scroll-loader
- Owner: thinkphp
- Created: 2011-02-18T11:03:24.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2011-02-18T15:44:22.000Z (almost 15 years ago)
- Last Synced: 2024-04-14T14:54:28.883Z (almost 2 years ago)
- Language: PHP
- Homepage: http://thinkphp.ro/apps/js-hacks/scroll-loader/demos/test-twitter-client/
- Size: 121 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ScrollLoader
============
Loads more content when a user reaches the end of a page. Fires an event when the user reaches a certain boundary specified by 'area' option.

First you must to include the JS file in the head of your HTML document.
#HEAD
How to use
----------
#JS
window.addEvent('domready', function(){
var page = 2, url = "more-tweets.php";
new ScrollLoader({
onScroll: function() {
var self = this;
$('content_tweets').adopt(new Element('img',{src: 'ajax-loader.gif', id: 'loader'}));
self.detach();
(function() {
//let's make a request for additional content
new Request.HTML({url: url,
onSuccess: function(responseTree, responseElements, responseHTML, reponseJavaScript) {
$('loader').destroy();
if(responseHTML == 'No found results.') {
$('timeline').set('html', $('timeline').get('html') + 'Older tweets are temporarily unavailable.');
return;
}
$('timeline').set('html', $('timeline').get('html') + responseHTML);
self.attach();
page++;
}
}).get({'page': page, 'amount': "14",'username': "mootools"});
}).delay(1000);
}
});
});
Note:
-----
This plugin is part of [PowerTools](http://cpojer.net/PowerTools/)
Demos:
------
You can view in action:
* [http://thinkphp.github.com/scroll-loader/](http://thinkphp.github.com/scroll-loader/)
* [http://thinkphp.ro/apps/js-hacks/scroll-loader/demos/test-twitter-client/](http://thinkphp.ro/apps/js-hacks/scroll-loader/demos/test-twitter-client/)
* [http://thinkphp.ro/apps/js-hacks/scroll-loader/demos/test-twitter-search/](http://thinkphp.ro/apps/js-hacks/scroll-loader/demos/test-twitter-search/)