I know that this is super simple with jQuery, although I am after a CSS only solution (if possible).
I have a list of divs, with the last item being an error message. I have a simple filtering system, and if none of the divs match the selected filter, I would like to display the error div.
HTML Structure:
<div id="listHolder">
<div class="listItem" data-filter-class="["filter1"]"></div>
<div class="listItem" data-filter-class="["filter2"]"></div>
<div class="listItem" data-filter-class="["filter1"]"></div>
<div class="listItem" data-filter-class="["filter4"]"></div>
<div class="errorItem">Nothing to display here</div>
</div>
What I am trying to achieve:
If a div does not match any of the filters, my filter plugin gives them the class of inactive
. Hence, I need to check if all divs with the class of listItem
also have the class of inactive
to give the errorItem
class the style of display:block
.
FYI I am using the Wookmark plugin for my list and filtering system. I am also using LESS.