Skip to content
Advertisement

Javascript: multi level menu slide on button click

Could you help me with this code?

JavaScript
JavaScript

I would like to make a menu slide with multi level but the element “slide-panel” is not showing up…

Advertisement

Answer

I’m not a big fan of mixing pure javascript with jquery .. so the next code is in jquery .. Also I prefer to use add/remove/toggleClass instead of hide/show()

JavaScript
JavaScript
JavaScript

Note: The problem when using .next() if the element has <!-- --> or </br> it will not select the correct element .. So you can use .closest().find() you’ll find it in my code above

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement