I’m trying to create a jQuery selector that will do something like this:
(.a OR .b OR .c) AND (.x OR .y OR .z)
Obviously, this doesn’t work:
$("(.a,.b,.c)(.x,.y,.z)")
I need it in a single selector so that I can use it as a filter in the Isotope plugin. http://isotope.metafizzy.co/docs/filtering.html
Here’s an example of what I want to achieve: http://isotope.metafizzy.co/demos/combination-filters.html, only I want to be able to select red AND blue. Is this possible?
Thanks!
By expanding the
AND(it’s basically a Cartesian product), this is equivalent to:so just replace the
ORs with,s and you’ve got a selector: