Reputation: 2276
I use the following code to filter the content in my grid via my filter menu at http://themes.visualise.ca/visualise/
$('.menu-categories-navigation-container a').click(function(){
var category = $(this).parent().attr('class');
var filters = ('.'+category);
$container.isotope({
filter: filters,
});
return false;
});
But I would like the item with the .thelogo class to always remain visible since the logo and menu are part of my grid. So I thought I could maybe use some syntax in order to add some kind of exception? Maybe there is a better way?
Many thanks for your time and help.
Upvotes: 0
Views: 1074
Reputation: 9429
The filter property in isotope is a selector string, feel free to add compound selectors (just add .thelogo to it).
$('.menu-categories-navigation-container a').click(function(){
$container.isotope({
filter: '.thelogo, .' + $(this).parent().attr('class')
});
return false;
});
ps: this will fail if any item has more than one class. As the selector would think it was looking for a tag with the name of the second class, inside the first.
edit: forgot period
Upvotes: 1
Reputation: 2276
The solution...
$('.menu-categories-navigation-container a').click(function(){
var category = $(this).parent().attr('class');
var filters = ('.'+category);
$container.isotope({
filter: '.thelogo, ' + filters,
});
return false;
});
Upvotes: 0