I
I
Indus Indusovich2015-10-24 02:31:27
JavaScript
Indus Indusovich, 2015-10-24 02:31:27

How to make a popover menu?

How to make such a dropdown menu without ul-li?
www.designchemical.com/lab/jquery-vertical-mega-me...

This is in jquery\javascript, how to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wol_fi, 2015-10-24
@Indus999

Do you care about tags? Well don't like ul > li make div > div.
The most trivial code would be something like this:

<div class="menu-item">
   <a href="#">menu name</a>
   <div class="sub-menu">
      sub menu content
   </div>
</div>
<div class="menu-item">
   <a href="#">menu name</a>
   <div class="sub-menu">
      sub menu content
   </div>
</div>
<div class="menu-item">
   <a href="#">menu name</a>
   <div class="sub-menu">
      sub menu content
   </div>
</div>
<script>
jQuery(document).ready(function($){
   $('.menu-item').hover(
      function(){
          $(this).find('.sub-menu').show();
      },
      function(){
          $(this).find('.sub-menu').hide();
      }
   );
});
</script>
<style>
.sub-menu{
 display:none;
}
</style>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question