Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
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
Reply

Bookmarks

Tags
isotope

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:14 AM.


Advertisement
Log in to turn off these ads.