View Single Post
Old 02-18-2013, 07:06 AM   PM User | #1
bdbolin
Regular Coder

 
Join Date: Jul 2011
Posts: 101
Thanks: 7
Thanked 6 Times in 6 Posts
bdbolin is an unknown quantity at this point
Isotope, simple question?

Hey guys, I could really use a hand. I'm using Isotope.js to filter some items. I found and am using the following code:

Code:
	var $container = $('#container'),
		$checkboxes = $('.filters input');
	
	$container.isotope({
		itemSelector: '.item'
	});
	
	$checkboxes.change(function(){
		var filters = [];
	// get checked checkboxes values
	$checkboxes.filter(':checked').each(function(){
	filters.push( this.value );
	});

	filters = filters.join(', ');
		$container.isotope({ filter: filters });
	});

It works, however I want to display multiple filters yet only of the ones selected. For example, I have one product, that might be cheap, and green. I have a second product that is expensive and green. So if a user checks to display green, and only cheap products, it will only display product 1, and not product 2. Right now, the code displays both.

Essentially what I'm needing is this: http://metafizzy.co/blog/new-demo-combination-filters/ however I'm having issues transferring the concept to the current code using checkboxes.

Any help would be great! Thanks!
bdbolin is offline   Reply With Quote