Make jquery menu tabs closed by default on load

时间:2016-04-15 15:16:27

标签: jquery

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?

1 个答案:

答案 0 :(得分:0)

像这样:

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