using popup menus and keypress

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Shap5202
Super Advanced
Super Advanced
Posts: 62
Joined: Thu Sep 29, 2005 2:36 pm

using popup menus and keypress

Post by Shap5202 »

Hey all,
I'm basically trying to simulate the functionality of the Start Button for Windows. If you press a certain button, the menu pops up and then be able to use the arrow keys to navigate it. I've got all the key trapping fine, and the pop up piece, just can't put them together. Here's what i tried...

Code: Select all

var mn = getMenuByName("mainName");
	
	popup("menuName");
		
	for(x = 0; x < _mi.length; x++){
		if(_mi[x][0] == mn){
			itemOn(x);			
			break;
		}
	}
this javascript method is called when the proper key down is detected. It pops up the menu, then searches through the items for the first item on that menu (is there a better way to do that??), and i figured I could just call itemOn() and use the arrow keys from there.

However, when i put the itemOn() call in there, the menu appears, but behind any other menu I have on the screen (like the z-index is not high enough) and the arrow keys do not do anything. W/o the itemOn() call, the menu pops up as expected.

If i open the menu with the mouse 'normally', the keypress module works correctly. Has anyone done this before and am I missing something?

Thanks
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Have you got a URL that we can see?

If we can see the problem, should be able to advise further
Post Reply