Answer the question
In order to leave comments, you need to log in
How to correctly clean up the number of blocks and apply the value in jQuery?
Good afternoon. Guys, we need help.
In general, there is a footer, it has a menu. It's built like this:
<div class="downMenu">
<ul class="reset">
<li></li>
</ul>
<ul class="reset">
<li></li>
</ul>
<ul class="reset">
<li></li>
</ul>
</div>
Answer the question
In order to leave comments, you need to log in
if ( $('.downMenu > ul').length < 4) {
$('.downMenu > ul').each(function() { $(this).addClass('SOMECLASS'); });
} else {
$('.downMenu > ul').each(function() { $(this).removeClass('SOMECLASS'); });
}
jsfiddle.net/koceg/2vLsmbnu
$resets = $('.downMenu').find('.reset');
$resets.toggleClass('some-class', $resets.length < 4);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question