Need delay in opening main menu

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
maditya
Beginner
Beginner
Posts: 5
Joined: Tue Feb 17, 2004 6:04 pm

Need delay in opening main menu

Post by maditya »

Hi, I'm using version 5.0 and needs the main menu to have a slight delay before dropping down. I've changed the var _menuOpenDelay (on menu_data.js) but no effect. Is menu_data.js the only place I need to modify _menuOpeDelay? If so, how do I make it work?

Thanks,
Mike
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Re: Need delay in opening main menu

Post by John »

maditya wrote:Hi, I'm using version 5.0 and needs the main menu to have a slight delay before dropping down.
I assume you mean before the subs drop down, correct?
maditya wrote:I've changed the var _menuOpenDelay (on menu_data.js) but no effect. Is menu_data.js the only place I need to modify _menuOpeDelay? If so, how do I make it work?
Yes, that's the only place. Keep making it bigger until you get the effect you want. Mine is at 750, for example (3/4 second).
John
maditya
Beginner
Beginner
Posts: 5
Joined: Tue Feb 17, 2004 6:04 pm

Post by maditya »

Thanks for your reply. Yes. I meant delay before the subs drop down. I've made it bigger but it doesn't take. It works when I changed _menuCloseDelay, just for testing, but not for _menuOpenDelay. Any ideas?
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

None offhand. I just went into mine and made some radical changes (both short and long), and the menu did what it was told.

Got a URL?
John
maditya
Beginner
Beginner
Posts: 5
Joined: Tue Feb 17, 2004 6:04 pm

Post by maditya »

URL: http://www.chicagocityblessing.org/temp/menutest.html

_menuOpenDelay is at 3000 but no delay.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

A few things (just because I have a headache and feel like being picky)...

1. Upgrade! You're running RC31, we're now at 5.02 FINAL release. That puts you way back.

2. Take the ; off of the 3000. You have _menuOpenDelay=3000; - should be _menuOpenDelay=3000

3. Menu items that are not used can be left out of the code; e.g., separatorcolor="";. Just dump it.

4. HTML-picky - tags should be closed in the opposite order they are opened. You have...

Code: Select all

aI("text=<b><u>Travel Planning</b></u>;url=;");
Should be...

Code: Select all

aI("text=<b><u>Travel Planning</u></b>;url=;");
<b> is being depreciated by the W3C, so the above should actually be...

Code: Select all

aI("text=<strong><u>Travel Planning</u></strong>;url=;");
John
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

The delay only works for child menus being opened from a parent menu.

As you are using the popup, the openMenuDelay value will have no effect.

This is a custom function that will open a menu, using popup() with a delay.

Code: Select all

<script>
function delayedPopup(_menu,_delay,_img) {
	args=arguments
	_newPopup="popup('"+args[0]+"')"
	if(args[2])	{
		_newPopup="popup('"+args[0]+"','"+args[2]+"')"
		
	}
	setTimeout(_newPopup,_delay)
}
</script>
You then need to call the menu using:

Code: Select all

onmouseover="delayedPopup('TravelPlanning',800,'TravelPlanningmenu')"
Hope this helps
Andy
maditya
Beginner
Beginner
Posts: 5
Joined: Tue Feb 17, 2004 6:04 pm

Post by maditya »

Thank you very much John and Andy! The menu delay works now.
maditya
Beginner
Beginner
Posts: 5
Joined: Tue Feb 17, 2004 6:04 pm

Post by maditya »

Hi,

Now that I have the delay working, the menu doesn't seem to close properly. If you just mouseover the main menu without focusing on it, the menu drop downs but won't close until you mouseover the submenus.
I've set the _menuCloseDelay=0 but no effect.

URL: http://www.chicagocityblessing.org/temp/menutest.html

Any ideas? Thanks!
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

I don't know javascript but I think the logical solution is to repeat popup for popdown.

Instead of using html tags in text, you could use style tags in the menu item like fontweight=bold;

maz
Post Reply