Forums › Forums › Search & Filter Pro › check tree
- This topic has 13 replies, 3 voices, and was last updated 9 years ago by
Anonymous.
-
Trevor(Private) March 31, 2016 at 9:29 am #41090
I am not entirely sure what you mean by a Check tree, but I guess you mean that the categories are shown in a select box, with categories and sub-categories? And you somehow want to collapse/open these in sections? If you were able to show an example of what you have and what you want?
Ross Moderator(Private) April 5, 2016 at 8:43 pm #41705Hi James
Actually it is possible using some clever CSS 🙂
Add this to your themes CSS file:
.searchandfilter input[type='checkbox'] + label + ul { display:none; } .searchandfilter input[type='checkbox'][checked='checked'] + label + ul { display:block; }
Thanks!
Trevor(Private) April 8, 2016 at 8:33 am #42021Hi James
Unfortunately, the CSS does not work with the way jQuery handles checked checkboxes. The second part of the code would need to be:
.searchandfilter input[type='checkbox']:checked + label + ul { display:block; }
I think. The technical reason is that the first method looks at the checked attribute of the input, but with jQuery, it never adds
checked="checked"
to the element when you click it (which is the attribute), instead it changes the DOM property of the element, and the way I have re-written it checks that property. -
AuthorPosts