T
T
tehfoxen2020-05-07 17:35:13
JavaScript
tehfoxen, 2020-05-07 17:35:13

How to collapse and expand the menu on click, except for the active item jquery?

How to collapse and expand the menu except the active item on jquery

<ul class="nav nav-tabs nav-justified">
         <li class="active collapse in toggle">
       <a href="#tab-1-0" data-toggle="tab">Пункт-1</a>
     <span></span></li>
         <li class="toggle collapse in" style="display: block;">
       <a href="#tab-1-1" data-toggle="tab">Пункт-2</a>
     <span></span></li>
         <li class="toggle collapse in" style="display: block;">
       <a href="#tab-1-2" data-toggle="tab">Пункт-3</a>
     <span></span></li>
      </ul>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Neverov, 2020-05-08
@deMone

Something like this:$('.nav li:not(.active)').toggle();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question