2016-08-11 02:21:28 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
var win = $(window);
|
|
|
|
win.scroll(function() {
|
|
|
|
if ($(document).height() - win.height() == win.scrollTop()) {
|
|
|
|
var formData = $('#pagination form:last').serialize();
|
|
|
|
if (formData) {
|
2016-12-28 11:39:20 +00:00
|
|
|
var pageno = $('#pagination input[name=pageno]:last').attr('value');
|
2016-08-11 02:21:28 +00:00
|
|
|
$('#pagination').html('<div class="loading-spinner"></div>');
|
2016-12-04 10:17:17 +00:00
|
|
|
$.post('./', formData, function (data) {
|
2016-12-28 11:39:20 +00:00
|
|
|
var lastImageHref = $('.result-images:last a').attr('href');
|
2016-08-11 02:21:28 +00:00
|
|
|
var body = $(data);
|
2016-12-28 11:39:20 +00:00
|
|
|
$('a[href^="#open-modal"]:last').attr('href', '#open-modal-1-' + pageno);
|
|
|
|
body.find('.modal-image a:first').attr('href', lastImageHref);
|
2016-08-11 02:21:28 +00:00
|
|
|
$('#pagination').remove();
|
|
|
|
$('#main_results').append('<hr/>');
|
|
|
|
$('#main_results').append(body.find('.result'));
|
|
|
|
$('#main_results').append(body.find('#pagination'));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|