下载其js,css,img资源
http://www.javascripttoolbox.com/lib/contextmenu/source.php
使用案例
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ContextMenu.aspx.cs" Inherits="UI_ContextMenu" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Jquery 插件之右键菜单的使用 -by wangtao </title>
<script type="text/javascript" src="../Misc/Js/Core/Jquery.js"></script>
<script type="text/javascript" src="../Misc/Js/Plugins/jquery.contextmenu.js"></script>
<link type="text/css" href="../Misc/Css/jquery.contextmenu.css" />
</head>
<body>
<script type="text/javascript">
var menu1 = [ {'Option 1':function(menuItem,menu) { alert("You clicked Option 1!"); } }, $.contextMenu.separator, {'Option 2':function(menuItem,menu) { alert("You clicked Option 2!"); } } ];
var menu3 = [ {'Show Alert':{ onclick:function(menuItem,menu) { alert("You clicked me!"); }, className:'menu3-custom-item', hoverClassName:'menu3-custom-item-hover', title:'This is the hover title' } }, {'Delete':{ onclick:function(menuItem,menu) { if(confirm('Are you sure?')){$(this).remove();} }, icon:'delete_icon.gif', disabled:false } }, {'Custom Hover Functions':{ hoverItem:function(c) { $(this).addClass(c).find('div').html('You just hovered over me!'); }, hoverItemOut:function(c) { $(this).removeClass(c).find('div').html('Sorry to see you go!'); } } }, {"You can't click me!":{disabled:true} } ];
$(function(){
$('.cmenu1').contextMenu(menu1,{theme:'vista'});
$('.cmenu2').contextMenu('#menu2');
$('.cmenu3').contextMenu(menu3,{theme:'vista'});
})
</script>
<div id="menu2" style="display:none;width:200px;background-color:white;border:1px solid black;padding:5px;"> This is my custom context menu </div>
<span class="cmenu1 example-target">Right-click here to trigger the context menu</span>
<p></p>
<span class="cmenu2 example-target">Right-click here to trigger the context menu</span>
<p></p>
<span class="cmenu3 example-target">Right-click here to trigger the context menu</span>
</body>
</html>