├── LICENSE.txt
├── README.md
├── demo
├── example.html
├── icons
│ ├── application-monitor.png
│ ├── application-table.png
│ ├── bin-metal.png
│ ├── book-open-list.png
│ ├── cassette.png
│ ├── magnifier-zoom-actual-equal.png
│ ├── receipt-text.png
│ └── shopping-basket.png
└── screenshot.png
├── jquery.contextmenu.css
├── jquery.contextmenu.js
└── simplecontextmenu.jquery.json
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011, Joe Walnes
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | A Simple Good Looking Context Menu, for jQuery
2 | ==============================================
3 |
4 | Yes, there are [loads](http://plugins.jquery.com/plugin-tags/context-menu) of context menu
5 | plugins already. But they require a fair amount of work to make them look good.
6 |
7 | This one is easy to use, small, and looks good.
8 |
9 | Demo
10 | ----
11 |
12 | * http://joewalnes.github.com/jquery-simple-context-menu/example.html
13 |
14 | Features
15 | --------
16 |
17 | * Tiny library. Only dependency is jQuery.
18 | * Simple API.
19 | * Looks good out of the box, with no additional tweaking.
20 | * Designed to look and behave like a standard Windows context menu.
21 | * There's so little code, it should be easy to add your own custom features.
22 |
23 | The menu looks like this:
24 |
25 | 
26 |
27 |
28 | Installation
29 | ------------
30 |
31 | Include the files `jquery.contextmenu.css` and `jquery.contextmenu.js` in your page `
`. You also need jQuery. It is recommended that you use the [HTML 5 DOCTYPE](http://ejohn.org/blog/html5-doctype/) to ensure rendering consistency.
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | ... rest of your stuff ...
40 |
41 | You can get the files from here:
42 |
43 | *
44 | *
45 |
46 | Usage
47 | -----
48 |
49 | The plugin introduces a `contextPopup()` method to the jQuery object.
50 |
51 | Assuming you have an element that you'd like to bind a context menu to:
52 |
53 |
hello
54 |
55 | You can wire up a context menu like this:
56 |
57 | $('#mythingy').contextPopup({
58 | title: 'My Popup Menu',
59 | items: [
60 | {label:'Some Item', icon:'icons/shopping-basket.png', action:function() { alert('clicked 1') } },
61 | {label:'Another Thing', icon:'icons/receipt-text.png', action:function() { alert('clicked 2') } },
62 | null, /* null can be used to add a separator to the menu items */
63 | {label:'Blah Blah', icon:'icons/book-open-list.png', action:function() { alert('clicked 3') }, isEnabled:function() { return false; } },
64 | ]});
65 |
66 | The 'isEnabled' function is optional. By default all items are enabled.
67 |
68 | Icons
69 | -----
70 |
71 | The icons should be 16x16 pixels. I recommend the [Fugue icon set](http://p.yusukekamiyamane.com/) (shadowless).
72 |
73 |
74 | kthxbye
75 |
76 | -[joe](http://joewalnes.com)
77 |
78 |
79 | [](https://bitdeli.com/free "Bitdeli Badge")
80 |
81 |
--------------------------------------------------------------------------------
/demo/example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
26 |
27 |
28 |
29 |
30 | right click in this box to show custom context menu
31 |