Answer the question
In order to leave comments, you need to log in
Why are images not loading when switching pages?
Hello. When switching pages, pictures in the news are not loaded. I do so
<div class="bottom-nav ignore-select" id="bottom-nav">
<div class="nav-load" id="nav-load">[next-link]Загрузить еще[/next-link]</div>
</div>
$(document).ready(function(){
var loadLink = $('#nav-load'), loadStatus = 0;
$(window).scroll (function () {
if ($(this).scrollTop() + $(this).height() + 0 > loadLink.offset().top) {
var urlNext = loadLink.find('a').attr('href');
if (urlNext !== undefined && loadStatus == 0) {
loadStatus = 1;
$.ajax({
url: urlNext,
beforeSend: function() {
ShowLoading();
},
success: function(data) {
$('#bottom-nav').remove();
$('#dle-content').append($('#dle-content', data).html()).after($('#bottom-nav'));
window.history.pushState("", "", urlNext);
HideLoading();
loadStatus = 0, loadLink = $('#nav-load');
}
});
} else {
loadLink.remove();
};
};
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question