Popup Menu : Menu 2 « GUI Components « JavaScript DHTML

Popup Menu


  Distributed as part of 'AT JsMenu' under the same terms (LGPL)
  Author: AT Mulyana (atmulyana@yahoo.com)
  Copyright (C) 2001-2006 AT Mulyana
  <title>Popup Menu</title>
<link href='AtJsMenu-classic.css' rel='stylesheet' type='text/css' />
<link href='popup-menu.css' rel='stylesheet' type='text/css' />
<script language='JavaScript' type='text/javascript' src='signs.js'></script>
<script language='JavaScript' type='text/javascript' src='browser.js'></script>
<script language='JavaScript' type='text/javascript' src='AtJsMenuKeys.js'></script>
<script language='JavaScript' type='text/javascript'><!--
if (navigator.family) {
  document.writeln("<"+"script language='JavaScript' type='text/javascript' src='compat-"+navigator.family+".js'"+"><"+"/script"+">");
<script language='JavaScript' type='text/javascript' src='AtJsMenu.js'></script>
<script language='JavaScript' type='text/javascript' src='menu.js'></script>
<script language='JavaScript' type='text/javascript'><!--
var g_oPopup = new AtJsMenuPopup();
oMenu = new AtJsMenu('Sub Menu 1 xxxxx');
oMenu.add(new AtJsMenuItem('Child Sub Menu 1'));
oMenu.add(new AtJsMenuItem('Child Sub Menu 2'));
oMenu.add(new AtJsMenuItem('Child Sub Menu 3'));
oMenu = new AtJsMenu('Sub Menu 2 yyyyy');
oMenu.add(new AtJsMenuItem('Child Sub Menu 4'));
oMenu.add(new AtJsMenu('Child Sub Menu 5'));
oMenu = oMenu.getItem(2);
oMenu.add(new AtJsMenuCheckBoxItem('A CheckBox Menu Item 1'));
oMenu.add(new AtJsMenuCheckBoxItem('A CheckBox Menu Item 2'));
g_oPopup.add(new AtJsMenuItem('Menu Item zzzzz'));
<script language='JavaScript' type='text/javascript' src='popup-menu.js'></script>
  <select style="position:relative">
<p style="margin:10px"><textarea id="txtTest" cols='100' rows='5'>Give focus this textbox
and then select a menu. How's the effect? Something wrong?</textarea></p>
<p style="margin:10px">
Right click anywhere on this page. It will bring up the context menu.
The context menu does nothing. You should only watch its behavior.
Beside right clicking, the popup-key (on win keyboard) can also be used. On Opera 7.5+, use ']'
(right square bracket).<br />
When right clicking is used, opera still shows its own context menu.
If you use popup-key (or ']' on Opera 7.5+), you can see the other directions to which the popup
is slidden when the popup comes up. These directions are new in version 1.2. Try these
combinations keys and you will see these directions:
  <li>Popup-key: 'south-east'</li>
  <li>Ctrl+Popup-key: 'south-west'</li>
  <li>Shift+Popup-key: 'north-west'</li>
  <li>Ctrl+Shift+Popup-key: 'north-east'</li>

<h3>View source to see the code!!</h3>

AtJsMenu20060627.zip( 161 k)

Related examples in the same category

1.AtJsMenu Demo
2.Example 1: Basic Menu From Existing Markup
3.Example 2: Basic Menu From Pure JavaScript
4.Example 3: Grouped MenuItem Instances From Existing Markup
5.Example 4: Grouped MenuItem Instances Using Pure JavaScript
6.Example 5: Grouped MenuItem Instances With Titles From Existing Markup
7.Example 6: Grouped MenuItem Instances With Titles Using Pure JavaScript
8.Example 7: Multi-tiered Menu From Existing Markup
9.Example 8: Multi-tiered Menu From Pure JavaScript
10.Example 9: Handling Click Events
11.Example 10: Listening For DOM-Related Events
12.Example 11: MenuItem Configuration Properties
13.Example 12: Setting Configuration Properties At Runtime
14.Example 13: Multi-tiered Menu with Progressive Rendering of Submenus
15.Website Left Nav Example (with submenus built from JavaScript) 1
16.Website Left Nav Example (with submenus built from markup) 2
17.OS-Style Programs Menu Example
18.Website Top Nav (with submenus built from JavaScript) 3
19.Website Top Nav (with submenus built from markup) 4
20.Drop down menu and sub menu
21.Vertical menu and image menu
22.Emulate XP start menu
25.menu for applications