Hello,
In our web app, our infinite scroll seems to be broken. Here is the basic setup of code that we use:
Scroll event listener:
//Set up a scroll timer to check for when we might need to get new data var self = this; $(window).scroll(function () { if ( self.scrollTimer ) { clearTimeout(self.scrollTimer); } self.scrollTimer = setTimeout(function() { self.scrollCheck(); }, 50); });
The actual function that is called when the scroll event happens:
scrollCheck: function() {
// do not fetch if stream does not exist
if($('#stream').length == 0)
return;
var scrollSelectedId = 'html';
var pageHeight = $("#stream").height();
var scrollHeight = $(scrollSelectedId).scrollTop();
var allowableOffset = $(window).height();
if(pageHeight - allowableOffset < scrollHeight) {
Stream.getMoreMedia();
}
}
I'm wondering if page height and scroll height need to be handled differently inside of the Tizen web app? Just to clarify one thing #stream is the id of our content div where we load all of our content into. We initially load this with 10 items, and then as the user scrolls down we continue to load in 10 more items each time. The problem currently is it never seems to load new content in.