插件下载地址:
http://www.trendskitchens.co.nz/jquery/contextmenu/jquery.contextmenu.r2.js
压缩版:
http://www.trendskitchens.co.nz/jquery/contextmenu/jquery.contextmenu.r2.js
压缩版:
http://www.trendskitchens.co.nz/jquery/contextmenu/jquery.contextmenu.r2.packed.js
插件中的参数说明:
Parameters
menu_id
The id of the menu as defined in your markup. You can bind one or more elements to a menu. Eg $("table td").contextMenu("myMenu") will bind the menu with id "myMenu" to all table cells.
Note: This behaviour has changed from r1 where you needed a "#" before the id
settings
ContextMenu takes an optional settings object that lets you style your menu and bind click handlers to each option. ContextMenu supports the following properties in the settings object:
bindings
An object containing "id":function pairs. The supplied function is the action to be performed when the associated item is clicked. The element that triggered the current menu is passed to this handler as the first parameter.
Note: This behaviour has changed from r1 where you needed a "#" before the id
menuStyle
An object containing styleName:value pairs for styling the containing <ul> menu.
itemStyle
An object containing styleName:value pairs for styling the <li> elements.
itemHoverStyle
An object containing styleName:value pairs for styling the hover behaviour of <li> elements.
shadow
Boolean: display a basic drop shadow on the menu.
Defaults to true
eventPosX
Allows you to define which click event is used to determine where to place the menu. There are possibly times (particularly in IE6) where you will need to set this to "clientX".
Defaults to: 'pageX'
eventPosY
Allows you to define which click event is used to determine where to place the menu. There are possibly times (particularly in IE6) where you will need to set this to "clientY".
Defaults to: 'pageY'
onContextMenu(event)
A custom event function which runs before the context menu is displayed. If the function returns false the menu is not displayed. This allows you to attach the context menu to a large block element (or the entire document) and then filter on right click whether or not the context menu should be shown.
onShowMenu(event, menu)
A custom event function which runs before the menu is displayed. It is passed a reference to the menu element and allows you to manipulate the output before the menu is shown. This allows you to hide/show options or anything else you can think of before showing the context menu to the user. This function must return the menu.
http://www.blogjava.net/supercrsky/articles/250091.html
jQuery右键菜单contextMenu实例
http://www.cnblogs.com/whitewolf/archive/2011/09/28/2194795.html
本文详细介绍了 jQuery ContextMenu 插件的使用方法及配置选项。包括插件的下载地址、参数设置如绑定事件、样式调整等。并提供了实例链接帮助理解。
4331

被折叠的 条评论
为什么被折叠?



