1

http://jsfiddle.net/L9wrt41g/

Working with the Sidr menu.

By default submenus are hidden.

.sidr ul.submenu {
display:none;
}

But as you can see in the fiddle, Sub List 2 has an active class.

<li class="active"><a href="#">Sub List 2</a></li>

Trying to figure out how to have the parent submenu visible by default if one of its children have an active class.

Therefore (since a submenu item has an active class), upon page load (and after clicking 'Toggle Menu') it should be visible by default, as such:

https://s23.postimg.org/uealsexqj/sidr.png

Brian Bruman
  • 883
  • 12
  • 28

1 Answers1

0

Sorry for the Wrong answer. Here you go

you should add this to your document ready function.

$("li.active").each(function (i,e) {
    $(e).parent().css("display","block");
});
Devian
  • 817
  • 1
  • 12
  • 22
  • That just shows it be default regardless if a child has an active class. What if there are multiple submenus? Updated fiddle: http://jsfiddle.net/L9wrt41g/1/ – Brian Bruman Dec 18 '16 at 00:34