isotope.javascript.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready( function() { | |
var $grid = jQuery('.grid').isotope({ | |
itemSelector: '.grid-item', | |
layoutMode: 'fitRows', | |
getSortData: { | |
title: '.title', | |
date: '.date' | |
} | |
}) | |
jQuery('.category').each( function() { | |
jQuery(this).closest('.grid-item').addClass(jQuery(this).text().toLowerCase()); | |
jQuery(this).remove(); | |
}) | |
jQuery('[data-filter]').click( function(e) { | |
e.preventDefault(); | |
$grid.isotope({ filter: jQuery(this).data('filter') }) | |
}) | |
jQuery('[data-sortby]').click( function(e) { | |
e.preventDefault(); | |
$grid.isotope({ sortBy: jQuery(this).data('sortby') }) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using this for an oxygen repeater which has infinite scroll as well.
The items visible on the page are correctly being assigned their category as CSS class, but all the items loaded when scrolling the page, are not.
What could be the issue?
Thanks!