M
M
Maxim Voronkov2018-01-30 19:28:10
JavaScript
Maxim Voronkov, 2018-01-30 19:28:10

How to add menu toggle in jquery?

Good evening colleagues. Created a drop down menu. But I can not add switching between visible menus.
The menu is available: https://codepen.io/anon/pen/eVmeNx
I want to achieve:
If menu: Production 1 is visible, then menu: Production 2 is hidden. And vice versa. At the moment they are both revealed.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
weranda, 2018-01-30
@Voolyman

In short and without going into details, then specifically for your example, this option may be suitable. Replace JS code:

$('.subnav-button').click(function () {

        $(this).next().slideToggle();
        $(this).parent().siblings().children().next().slideUp();

});

D
Dima, 2018-01-30
Dolgoter @DDolgy

https://codepen.io/DimaDolgoter/pen/JpoOmK
made by analogy. red color on click, while for others it removes. adapt to your code.)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question