I want to dynamically load data while Scrolling a GSP Page Down like facebook does.
Is that possible ?
I am using grails 1.3.7 thanks.
I want to dynamically load data while Scrolling a GSP Page Down like facebook does.
Is that possible ?
I am using grails 1.3.7 thanks.
You can detect whether scroller has reached the end of page. If so, just load new piece of information. Something like
$(window).scroll(function(){
if ($(window).scrollTop() == $(document).height() - $(window).height()){
loadNewData();
}
});
function loadNewData(){
/* add code to fetch new content and add it to the DOM */
}
Here is an example on jsFiddle
http://jsfiddle.net/QsNCy/
You can also refer tag remotePageScroll of remote-pagination plugin version 0.3, to load and append more records to the existing list on a click of a button, just like what linkedin does. Cheers!