vudoanthang

vudoanthang does not currently provide support for this item.

6 comments found.

How easy is it to place icons?

x-context-menu have 144 icons, please see css/x-context-menu-icons.css file for more detail. The icon is getting from http://www.famfamfam.com/lab/icons/mini/.
to defined the new icon, you must create a css class define your’s icon.
Example:

.x-context-menu>ul>li>.your_class_name{
  background: url(“your_icon_path/your_icon_name.gif”) no-repeat center;
  width:16px;
  height:16px;
}

Next, you add your_class_name to icon property of the menu element. Example:
menu[‘your_element_name’] = {icon:’your_class_name’,text:”Your’s menu text “};

Best,

Hi!

How can I close all open xcontentmenu instances at once when clicking on another?

Regards

Hi marcelmeissner. You can close all open xcontextmenu instances by script below
$('.x-context-menu').hide();

Best,

The demo is not working. I am trying it but the default firefox menu appears!

I have tested, it still works normally. which version firefox you are using?

Can this be dynamically generated for items? So let’s say you have 3 items… A, B, C. Can A have a different menu than B and C? Also, does this have full documentation for customizing and adding to a page?

Yes, this be dynamically generated different menu for each item (A,B,C….) in a page and have full document for customizing.

Ok, so I’ve been messing around with this and have been going over the docs, but can’t seem to figure out how to get each menu item to go to different URLs. Is there something I’m missing?

For example: menu[‘link’] = {icon:’link’,text:’Link’,callback:callback}; How would I get this menu item to go to www.google.com and menu[‘link2’] = {icon:’link’,text:’Link2’,callback:callback}; to go to www.yahoo.com?

Hi Voudini,

This is a example for you.
var menu = {};
var google = function(target,element){
    window.location = 'http://www.google.com';
};
var yahoo = function(target,element){
    window.location = 'http://www.yahoo.com';
};

menu['copy'] = {text:'Go to google',callback:google};
menu['paste'] = {text:'Go to yahoo',callback:yahoo};
$('#id1').xContextMenu(menu);
by
by
by
by
by
by