Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Child terms unticked by default › Reply To: Child terms unticked by default
July 19, 2022 at 11:51 am
#38479
Participant
I’m so close, I don’t know if you can help nudge it over the line.
jQuery(function($){
$('*[data-lvl]').removeAttr('data-lvl');
$(".asp_option_cat_level-1").hide();
$(".asp_option_cat_level-2").hide();
$(".asp_option_cat_level-0").click(function(){
$(this).siblings('.asp_option_cat_level-1').toggle();
$(this).siblings('.asp_option_cat_level-2').hide();
});
$(".asp_option_cat_level-1").click(function(){
$(this).siblings('.asp_option_cat_level-2').toggle();
});
});
How do I get this hide/show only the children of the checked parent rather than all of the children when a parent is clicked? I also need to figure out how to have the children automatically unchecked when a parent is unchecked.