I need a solution for filtering a group of items with multiple checkboxes. I found a fiddle and modified it to my needs for testing purposes:
Before it was based on "data-category" but I need it to be based on classes. Works just fine but there is one thing that I can't figure out myself. When filtering I don't want the actual element having the class (.red, .small, .africa) to hide or show but actually an element that it is nested in, I named it ".test" in my example and made it a div.
I think you can somehow do this using .closest('.test') but I don't know where to put it exactly.
Can you help me with this? I would really appreciate it.
Aucun commentaire:
Enregistrer un commentaire