Is there any way to load data while scrolling in jquery for Iphone (mobile websites). This example works in Safari, Chrome but not in the iPhone: http://www.webresourcesdepot.com/dnspinger/
Thanks
Is there any way to load data while scrolling in jquery for Iphone (mobile websites). This example works in Safari, Chrome but not in the iPhone: http://www.webresourcesdepot.com/dnspinger/
Thanks
Yes there is a way - the best to do it is initiating an AJAX request to a server side page to retrieve more data from the database.
The website you have mentioned is doing just that however on a device you will need to take the URL box into consideration I believe this is 60px?
$(window).scroll(function () {
$(window).scrollTop() + 60 == ($(document).height() - $(window).height()) {
doFunction();
}
});
doFunction() {
$.post('getPosts.php?action=loadmore&endId=' + $('.element:last').attr('id'));
function(data) {
if (data != '') {
$(".element:last").after(data);
}
}
}
This is just an example of how you could do this?