Skip to content

Instantly share code, notes, and snippets.

@Spellhammer
Created November 13, 2020 17:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Spellhammer/83f69332af65ed96cefd5e56a27438ce to your computer and use it in GitHub Desktop.
Save Spellhammer/83f69332af65ed96cefd5e56a27438ce to your computer and use it in GitHub Desktop.
isotope.javascript.js
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') })
})
})
@lamat1111
Copy link

lamat1111 commented Jan 21, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment