Is there a way we can add javascript behaviors to the popup menu in java actions?
Return to Recent Questions
Q:
Is there a way we can add javascript behaviors to the popup menu in java actions? For
example, is there a way we can add an onClick function to a popup menu in java item (eg,
onClick="return MyFunction( )" ) so that we can catch and process key
events?
I'm really hoping there's a way of doing this...
A:
Unfortunately, you can't assign onmouseover/onClick/onContextMenu event to each item.
However, you can achieve this by using standard html objects within
popup menu in java items, for example:
var menuitems = [
["<div onContextMenu='your_code_here'>item text</div>", ""]
];
You can use your own Javascript code instead standard links. For example:
var menuItems = [
["text", "javascript:your_code_here"]
];
Return to Recent Questions
Related:
- Aug 28, 2006 - Top menu in a 6x4 cell layout (effectively a rectangle)
- Aug 30, 2006 - Can all the java script be contained with in the html and not use an external .js file?
- Sep 02, 2006 - Can I show / hide the javascript floating menu .
- Sep 02, 2006 - Little vertical spacers between menu items in the drop down menu.
- Sep 05, 2006 - Can I say to deluxe-menu "use wrapping"?
- Sep 05, 2006 - Change cursor to a hand when over a menu link...
- Sep 06, 2006 - The alighment of the dropdown menu is off to the right in Firefox...
- Sep 06, 2006 - The Items of the javascript tree view stay expanded in the same state.
- Sep 06, 2006 - Can't see my javascript vertical tree menu in FireFox.
- Sep 11, 2006 - How can I hide my dropdown menu on print?
- Sep 11, 2006 - If I use doctype the settings of the submenus in javascript dropdown menu get lost.
|