Paging in Jquery

38 views
Skip to first unread message

Mayur pimple

unread,
May 15, 2012, 5:05:23 AM5/15/12
to php...@googlegroups.com
Hi

I have fetch data in array. now i want to show in paging.
Please help.

--

Best,

M



 


Parag Arora

unread,
May 15, 2012, 6:27:47 AM5/15/12
to php...@googlegroups.com
You can have pagination onScrolling when div has reached last row. 

Define onScroll to detect event when you are at 100pf of bottom edge. Append data on loadData() function. 

function onScroll(event) {

// Only check when we're not still waiting for data.

if(!isLoading) {

// Check if we're within 100 pixels of the bottom edge of the browser window.

var closeToBottom = ($(window).scrollTop() + $(window).height() > $(document).height() - 100);

if(closeToBottom) {

loadData();

}

}

};


In document.read function, bind to scroll event by 

$(document).bind('scroll', onScroll);




--

Best,

M



 


--
On Twitter ==> http://twitter.com/phpcamp
On Facebook ==> http://www.facebook.com/campersfanpage
 
 
 
You received this message because you are subscribed to the Google
Groups "phpcamp" group.
To post to this group, send email to php...@googlegroups.com



--
Parag


Reply all
Reply to author
Forward
0 new messages