jQuery onScrollBeyond and scrollExtend plugins

The scrollExtend plugin is designed to automatically load new content at the bottom of the screen (by appending to a DOM element) when the user scrolls beyond the element, much like Facebook does with their status updates. The existing infinite scroll plugin was primarily designed to integrate with WordPress, which didn’t really suit my purposes.

There are two plugins encapsulated here – onScrollBeyond, which allows the developer to specify a callback to be run when an element is scrolled beyond (or the end of the document is reached), and scrollExtend, which is simply an implementation of onScrollBeyond that automatically loads new content via ajax when a user scrolls past an element.

Works with jQuery 1.3.2 and jQuery 1.4.2

Tested in IE6, IE7, Firefox, Chrome, Safari

Update v1.0.1 – fixed scrollExtend would get stuck in a disabled state if beforeStart returned false, even if it returned true on subsequent calls

– See more at: http://thisiscontext.com/tools/jQuery-infinite-scroll-live-scroll

here how i used this,

</pre>
limit = 10;
 page = 0;

 $('#customersinfo').onScrollBeyond(function(){
 page=limit+page;
 $.post("tsz_analytics_controller.php?c=fetchCustomerInfo&venueId=<?php echo $_GET['venueId'] ?>&limit=" + limit + "&page=" + (page) + "", function(data) {
 $('#customersinfo').append(data);
 });

 });
<pre>
Advertisements

One thought on “jQuery onScrollBeyond and scrollExtend plugins

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s