Based on http://tutorialzine.com/2011/06/beautiful-portfolio-html5-jquery/ tutorial I am trying to implement a sort function to my app.
The problem:
I have the items that I will sort later with quicksand jquery plugin in this format:
<ul>
<li class="car">Audi A6</li>
<li class="car">Audi A8</li>
<li class="car">BMW 328Ci</li>
<li class="hobby">Skying</li>
<li class="hobby">Skating</li>
<li class="hobby">Running</li>
<li class="food">Pizza</li>
<li class="food">Salat</li>
<li class="food">Chicken</li>
</ul>
and then I have 3 checkboxes to be used to sort what to show and what to not:
<ul id="filter_sources">
<li><input type="checkbox" id="source" value="car" />car</li>
<li><input type="checkbox" id="source" value="hobby" />hobby</li>
<li><input type="checkbox" id="source" value="food" />food</li>
</ul>
What I want to do is that for each checked checkbox run the quicksand plugin and show the checked boxes, so if the car and hobby checkboxes are checked to show car and hobby lists
I am asking this because in the tutorial they do it this way:
$('#filter_sources').live('click',function(e){
var link = $(this);
link.addClass('active').siblings().removeClass('active');
// Using the Quicksand plugin to animate the li items.
// It uses data('list') defined by our createList function:
$('#videosList').quicksand(link.data('list').find('li'));
e.preventDefault();
});
and I did some attempts to try for each checked input but I didn't succeed.