This is regarding input checkbox for filtering jQuery isotope itemselector.
Refer to demo here, checkboxes are checked when the page is load. However I stumble upon the problem when all is unchecked by user, it will just show all .items
instead of an empty container.
$checkboxes.change(function(){
var filters = [];
// get checked checkboxes values
$checkboxes.filter(':checked').each(function(){
filters.push( this.value );
});
// ['.red', '.blue'] -> '.red, .blue'
filters = filters.join(', ');
$container.isotope({ filter: filters });
});
Many thanks in advance, cheers