I'm using the Isotope JS plugin (v2.0.1) from Metafizzy to filter a library of publications, and I am using more than one filter (e.g. publisher and industry). Is there a way to check if my combination of filters has resulted in zero results, and then show a corresponding message... something like "Sorry. No matching items found."
$container.isotope({ filter: '.your-filter' });
if ( !$container.data('isotope').$filteredAtoms.length ) {
$('.message-div').fadeIn('slow');
} else {
$('.message-div').fadeOut('fast');
}
You could also use hide/show or a number of other effects instead of fadeIn and fadeOut depending on your effect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With