javascript - Individual class Attribute visibility using jquery -


I ; Li & gt; s and trying to show them based on their class names, most of which are multiple classes) the user selects the checkbox selector for personal characteristics. I have however noticed that in my implementation, it looks for the specialty, and works, regardless of all other selection selectors on the form.

As you can see, if you check 'A' box, then it hides 'A', 'AB', 'AC' and 'ABC'. Although the user thinks that any & lt; Li & gt; Features are visible with 'B' and 'C', and 'AB', 'AC' and 'ABC' are hidden

So if the user chooses to hide 'A' , Then only hide and

'A'

, since it's just 'A', and 'B' and 'C' Also, the only one that wants to show the user is showing the following:

'B', 'C', 'AB', 'AC', 'BC', 'ABC' / P>

. If 'A' and 'B' are selected to hide the user, then the following will be hidden:

'C', 'AC', 'BC' and 'A', ' B ',' AB 'ABC'

, because they have a 'C' class characteristic. I am assuming that I have to make an array or something similar, and then have to look for any attribute within the array, and hide them accordingly

Here's a way to do this with a little less code:

( 'Change', function () {var notSelectedList = $ ('Form input: no (checked') '). Map (function () ($') '$' (This) .attr ('name'); $ ('.view li'). (Function () {$ (t of) .toggle ($ (this) .is (notSelectedList);}) ; });a????

This works by creating a comma separated list of squares that are not hidden, then checks all the list items for any of these sections - which are slightly The easiest way I think is checking that.

Comments