Answer the question
In order to leave comments, you need to log in
Masonry + drupal, how to properly scope?
Hello.
Such a thing.
I'm using masonry Drupal 7 to display the Views of the grid.
The second day I'm trying to fasten a script for loading content that falls into the scope of the browser window.
pagers are not suitable, because I need to load not a new page, but simply hang up an event. And below is a page pager.
I'll try to be a little more detailed: I
use the animate library.
masonry-item container is styled
(this is the container from the masonry module that contains the node)
.masonry-item{
opacity: 0;
}
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
$(window).scroll(function () {
$('.masonry-item').each(function () {
var imagePos = $(this).offset().top;
var bottomOfWindow = $(window).scrollTop() + $(window).height();
if (imagePos <= bottomOfWindow ) {
$(this).addClass("fadeInUp");
}
});
});
$(document).ready(function () {
$('.masonry-item').each(function () {
var imagePos = $(this).offset().top;
var bottomOfWindow = $(window).scrollTop() + $(window).height();
if (imagePos <= bottomOfWindow ) {
$(this).addClass("fadeInUp");
}
});
});
Answer the question
In order to leave comments, you need to log in
The problem is, when the page is loaded, n number of nodes get into the scope.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question