Steffi
Steffi

Reputation: 7067

How to display submenu in jQuery?

Actually, my sub-menu is on display : none. I need to display the class sub-menu in jQuery. How can do that ?

<li class="menu-item" id="menu-item-2292">
<a href="/photos">Photos</a><br/>
<ul class="sub-menu"><br/><li class="menu-item" id="menu-item-2296">Portrait</li>
</ul>
</li>

Upvotes: 2

Views: 2444

Answers (2)

Peter Smeekens
Peter Smeekens

Reputation: 664

$('.menu-item').hover(
  function () {
    $('.sub-menu').show();
  },
  function () {
    $('.sub-menu').hide();
  }
);

Upvotes: 4

Pranay Rana
Pranay Rana

Reputation: 176936

(".sub-menu").Show() - to show menu

(".sub-menu").Hide() - to hide menu

Upvotes: 1

Related Questions