Skip to content

Instantly share code, notes, and snippets.

@rnaud
Created February 25, 2014 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rnaud/9205568 to your computer and use it in GitHub Desktop.
Save rnaud/9205568 to your computer and use it in GitHub Desktop.
$(".search.themes li input").change(function() {
var classes = []
$(".search.themes li input:checked").each(function(){
console.log($(this).siblings(".box"))
var classList = $(this).siblings(".box").attr('class').split(/\s+/);
$.each( classList, function(index, item){
if (item != 'box') {
classes.push(item)
}
});
});
if (classes.length == 0) {
$(".eboite").fadeIn();
return;
}
$(".eboite:not(.pub)").hide();
classes.push("pub");
$.each( classes, function(index, item){
$(".eboite."+item).fadeIn()
});
console.log(classes);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment