Endless loading of posts not in body, and in the random block?

I had to management that would scroll body was in z-index

I banned html, body
overflow: hidden;

and put in the body block .body_scroll
{
 overflow-y: scroll;
 height: 100vh;


which now is the parent of all content

BUT I am uploading posts (infinite scroll)
and now he didn't react When scrolls are at the bottom of the page posts are not loaded

I understand, because the script is designed to work with body..XS

How to make so that would work loading in a block .body_scroll

Use it
And this is the script which all works:

$(function () {

var $boxes = $('.loop');
$boxes.hide();

 var $container = $('#content_masonry');
$('.loop-loader').fadeOut(250);
 $container.imagesLoaded( function() {
$boxes.fadeIn(100);

$container.masonry({
 itemSelector : '.loop',
 columnwidth: 300,
 gutter: 24,
 isFitWidth: true,
 isAnimated: !Modernizr.csstransforms
});
});


var msnry = $container.data('masonry');

$container.infiniteScroll({
 path: '#page-nav a',
 append: '.loop',
 outlayer: msnry,
 history: false
});
});


Thank you for your attention!
June 14th 19 at 18:26
1 answer
June 14th 19 at 18:28
But the scroll event does not catch tried, without any lib?
um What? ) What it is and what to eat? ) - estefania32 commented on June 14th 19 at 18:31
how is it, really? - estefania32 commented on June 14th 19 at 18:34
it is triggered when you scroll.
You can compare the position of the scrolling element sizes. - britney38 commented on June 14th 19 at 18:37
in General, I understand, thank you
But let's say the script that tracks the scroll, where it is not:

$(document).ready(function() {
 $(window).bind('mousewheel DOMMouseScroll MozMousePixelScroll', function(event) {
 delta = parseInt(event.originalEvent.wheelDelta || -event.originalEvent.detail);
 if (delta >= 0) {
$('#content').html('Up');
 } else {
$('#content').html('Down');
}
});
})


How to apply it, which would work idea? - estefania32 commented on June 14th 19 at 18:40
if no scroll, then take the number of elements and multiply by their height, take into account there paddingy all sorts and in the end look. - britney38 commented on June 14th 19 at 18:43
not well, scrolling is Using css it is set in place in diva, which covers scrolling Simple such script found that to follow when there is no scrolling, and have me there, the current th XS to do now with the script I only Can get acquainted while the current open/close, add, style, etc =)
Not know what now to do next
Created a question: to Catch scrolling in the block in which the posts are loaded (infinite scroll)? - estefania32 commented on June 14th 19 at 18:46
you go that way.)
learn.javascript.ru - britney38 commented on June 14th 19 at 18:49
well bliiiin - estefania32 commented on June 14th 19 at 18:52
what's wrong?) - britney38 commented on June 14th 19 at 18:55

Find more questions by tags JavaScriptjQuery