3
Good morning!
Could I get more than one element with Jquery?
For example, I’m doing this in my code:
if (!is992()) {
$j('.filters .title--sm').click(function(){
$j('.filters__list').slideToggle(50);
$j('.filters__filtered').slideToggle(50);
$j('.filters .title').toggleClass('active');
});
}
I wanted to optimize these two lines:
$j('.filters__list').slideToggle(50);
$j('.filters__filtered').slideToggle(50);
Could I take both classes and use one line? For example:
$j('.filters__list', '.filters__filtered').slideToggle(50);
So I know you can’t, but I was wondering if there’s anything like that I could use.
Thank you!
yes, only the formatting that is not very good use like this: $j('. filters_list . filters_filtered'). slideToggle(50);
– Bsalvo