Jakub Jakub - 7 months ago 13
Javascript Question

Make jquery menu tabs closed by default on load

like in the title, I need to have menu tabs closed by default on load.
The code is:

$('#cssmenu li.active').addClass('open').children('ul').show();


When you change "show" to "hide", it works, but only after the second click...
Any ideas?

Answer

Like so:

$('#cssmenu li.active').removeClass('open').children('ul').hide();