Start a new discussion

To start a new discussion please visit the discussions section of the GitHub home page of the project.

Discussions on GitHub

You can also search our old self-hosted forums for any useful information below but please note that posting new content here is not possible any more.

Reply To: Separate button triggers dropdown menu

Home Forums Older releases 0.9.x Separate button triggers dropdown menu Reply To: Separate button triggers dropdown menu

#2437
admin
Keymaster

Hi,

Yes, this is the method but if the option hideOnClick is set to true (and it is by default), the sub menu will be reset immediately after it is activated since the button click bubbles to the document and there the hideOnClick hander is executed. You can avoid this, for example, by calling the method asynchronously with a short timeout like this:

$('#button').on('click', function() {
     setTimeout(function() {
          $('#main-menu').smartmenus('itemActivate', $('#list-item > a'));
     }, 1);
});

Let me know if you still have any troubles.