EasyUI Forum
May 21, 2024, 07:20:47 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Menu Item - context menu  (Read 4902 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« 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
« Last Edit: August 27, 2016, 05:38:14 AM by devnull » Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: August 28, 2016, 01:43:09 AM »

Please try to set the 'hideOnUnhover' property to false for your main menu.
Logged
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« Reply #2 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
});
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!