I'm trying to use isotope.js on my wordpress theme.
I would sort the object in this way, where "Series,Music,Cultura,Sport" are "filter" generated by the custom taxonomy.
var $container = $j('.containerport');
$container.isotope({
stamp: '.stamp',
itemSelector: '.thumbportfolio',
getSortData : {
Series : function( $elem ) {
var isSeries = $j($elem).hasClass('Series');
return (!isSeries?' ':'');
},
Musica : function( $elem ) {
var isMusica = $j($elem).hasClass('Musica');
return (!isMusica?' ':'');
},
Cultura : function( $elem ) {
var isCultura = $j($elem).hasClass('Cultura');
return (!isCultura?' ':'');
},
Sport : function( $elem ) {
var isSport = $j($elem).hasClass('Sport');
return (!isSport?' ':'');
}
}
});
I would create a dynamic getSortData because if I add a new filter it should appear automatically without put hands inside the code.
Is it possibile?
Maybe with an array or a for cycle, but I don't know how to access to the list of the filter through jquery.
Thanks!