EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on August 27, 2016, 05:24:51 AM



Title: Menu Item - context menu
Post by: devnull on August 27, 2016, 05:24:51 AM
Hi;

Do you have any examples of how to create a context menu on a menu item ?

I have this:
Code:
$('#item').on("contextmenu", function (e) {
          e.preventDefault();
          var node = $(e.target).parent('.menu-item');
          if(node.length > 0){
            $('#mencm').menu('show',{left:e.pageX,top:e.pageY});
          }
        })

But when I move my mouse to the context menu the main menu disappears ?


Thanks


Title: Re: Menu Item - context menu
Post by: stworthy on August 28, 2016, 01:43:09 AM
Please try to set the 'hideOnUnhover' property to false for your main menu.


Title: Re: Menu Item - context menu
Post by: Pierre on August 28, 2016, 10:58:07 PM
If you want to do that (what stworhty said) for all menus, then do this:

Code:
$.extend($.fn.menu.defaults, {
  hideOnUnhover: false
});