jquery - show/hide div based on multiple selections

Mipsaspebra

New Member
I have a (php/html/jquery/css) page where i'm displaying tags at the top (e.g. green, white, fruit, vegetable)On the page I have divs marked appropriately with classes:\[code\]<div class="green fruit">apple</div><div class="green vegetable">broccoli</div>\[/code\]etc.I'd like to show/hide divs based on which tags have been toggled show/hide.By default everything is shown. Clicking a tag at the top will toggle the corresponding divs.The tricky part is to show divs if any of its classes are toggled to 'show' and hide if all of its classes are toggled to hide.I'm probably making this harder than it needs to be. Thanks for your advice!
 
Back
Top