Answer the question
In order to leave comments, you need to log in
How to make a selection and apply actions?
How to apply an action to a parent element under a certain condition... I don't understand how to explain correctly. In general, there are several filters on the site, by default they are closed and the first item is selected for each filter. When another item is selected, a class is added to it, and the label is removed from the first item. The idea is that the filters will be opened if the child links have other than the first checked class.
I will give my working script, it only works correctly for the first block with a filter, and for the other following it works partially incorrectly.
$(function(){
$(".filter_group .filter_item:not(:first) a.checked").parents(".filter_group").css("display","block");
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question