How to get dropdown menu to open/close on click rather than hover?

后端 未结 5 1730
星月不相逢
星月不相逢 2021-02-06 07:32

I am very new to javascript and ajax/jquery and have been working on trying to get a script to open and close the drop menu on click rather that hover.

The menu in quest

5条回答
  •  轮回少年
    2021-02-06 08:08

     $(function() {
         $("#lang-selector li:first").click(function(){
             $('ul:first',this).toggle();
         })
     });
    

    Using toggle will require you to click to open then reclick to close

提交回复
热议问题