18 lines
638 B
JavaScript
18 lines
638 B
JavaScript
|
$(document).ready(function() {
|
||
|
$(window).scroll(function() {
|
||
|
if($(window).scrollTop() == $(document).height() - $(window).height()) {
|
||
|
$.ajax({
|
||
|
url: './api/p/'+$('#posts').data('last'),
|
||
|
dataType: 'json',
|
||
|
success: function(msg) {
|
||
|
var html = "";
|
||
|
for(var i = 0; i < msg.items.length; i++)
|
||
|
if(msg.items[i].id)
|
||
|
html += "<a href=\"./"+msg.items[i].id+"\" title=\""+msg.items[i].mime+"\"><img class=\"thumb\" src=\"./t/"+msg.items[i].id+".png\" /></a>\n";
|
||
|
$('#posts').append(html);
|
||
|
$('#posts').data('last', msg.last);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
});
|