The right context menu code is from
RightContext
by Harel Malka. The code has been slightly modified and integrated with the
web framework for convenience.
Context menus are menus which are shown for a certain context. They're more
commonly known as right-click menus, as it is typically a right click which
shows them. The menus show actions which are possible for a thing (or area
containing a thing) which has been right clicked.
Context menus are very useful for grouping like functionality, and also clean
up the page, as the functionality is only shown when chosen to display. The
disadvantage, if any, of context menus within web pages is that the user may
not be aware of the menu. Application familiarity is required.
Here's a working example:
/lib/context/contextMenu.css
/lib/context/contextMenu.js
right click here
... and the full code listing:
First, include
/lib/context/contextMenu.css
and
/lib/context/contextMenu.js.
For each element which is to trigger a context menu, define a context attribute with
a value being the name of the context menu to show. In this case, the div has a context
attribute of simple, meaning that it will show the menu named 'simple'.
]]>