Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:11

Error: _menuCloseDelay is not defined


Poster: bobbitt
Dated: Sunday March 29 2009 - 22:41:26 BST

Hi all,

Been working with the menu for a while now getting it ready to go up on my site. Works great with one small exception... when I include the menu on a page from my forums (Simple Machines) the drop-downs don't work. They work fine on non-forum pages. I'm using the PHP based menu (non-final prototype here: http://army.ca/includes/menu/).

The error I get is:

Code:
Error: _menuCloseDelay is not defined
Source File: http://forums.army.ca/includes/menu/milonic_menu_code.js
Line: 21


Unfortunately I'm not much of a JavaScripter so I'm at a bit of a loss... Any hints as to where to look? I have not modified the original javascript files. Since it's only a problem on forum pages, I'm thinking maybe it's a conflict with some of the js used there. Anyone running SMF 2.0 RC1 see similar issues?


Thanks
Mike

Re: Error: _menuCloseDelay is not defined


Poster: John
Dated: Monday March 30 2009 - 17:53:18 BST

Using IE7 and FF3.0.8, I'm having no trouble seeing the dropdowns in your forum area.

Re: Error: _menuCloseDelay is not defined


Poster: bobbitt
Dated: Tuesday March 31 2009 - 16:26:46 BST

Hi John,

That's true... I have the old menu still in place for regular users, and the new only just for site admins, but that makes it pretty hard to test. :) So Now if you pass in "newmenu=1" (E.G. http://forums.army.ca/?newmenu=1) then you should be able to see the new menu in action.

Suggestions welcome. :)


Thanks
Mike

Re: Error: _menuCloseDelay is not defined


Poster: Ruth
Dated: Tuesday March 31 2009 - 19:27:10 BST

Hi,

You left some coding out of your data area. You have removed the menuCloseDelay stuff. Try adding back right at the top under the script tag which is followed by the styles you have.

Code:
fixMozillaZIndex=true; //Fixes Z-Index problem  with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=2;
_subOffsetLeft=-2;


Ruth

Re: Error: _menuCloseDelay is not defined


Poster: bobbitt
Dated: Tuesday March 31 2009 - 19:56:33 BST

Thanks Ruth, you're definitely on to it there!

I'm using the PHP based menu (under the extras dir) so the items you noted above are defined in mm_phpconfig.php for me:

Code:
$menuVars=array();
$menuVars["menuCloseDelay"]=500;
$menuVars["menuOpenDelay"]=150;
$menuVars["subOffsetTop"]=0;
$menuVars["subOffsetLeft"]=0;


Despite having these defined, and including mm_phpconfig.php, they don't seem to appear in the output HTML. What's odd is that for non-forums pages, these items are defined properly, which is why the script works for non-forum pages. I guess the trick now is to figure out what's preventing these definitions from being displayed when constructing a page for the forums.

I copied the js definitions for these items into the PHP script generating the menu, and that works... though for non-forums pages, they're dfined twice, so I still really haven't figured out the problem, just a workaround. I'll keep digging... you've definitely put me on the right path, thanks!

Re: Error: _menuCloseDelay is not defined


Poster: Ruth
Dated: Tuesday March 31 2009 - 20:21:58 BST

Hi,

This might be something you need to report via the support ticket area. I understand what you are saying but I have no idea about any programming type stuff, so I'd never be able to figure out why it is not outputting on the forum pages, it would seem that there has to be some kind of conflict or something based on whatever is creating the forum. Anyway, try setting a support ticket here explaining that the config file doesn't seem to be out putting that menuClose/open stuff on your forum pages.

http://www.milonic.com/support/

Ruth

Re: Error: _menuCloseDelay is not defined


Poster: bobbitt
Dated: Tuesday March 31 2009 - 20:50:56 BST

Thanks for your help Ruth, I'll do that!

Cheers
Mike

Re: Error: _menuCloseDelay is not defined


Poster: John
Dated: Tuesday March 31 2009 - 23:05:50 BST

Using the new link you provided, IE8 and FF3.0.8 I am still able to see all menus in the forum area.

Re: Error: _menuCloseDelay is not defined


Poster: bobbitt
Dated: Wednesday April 1 2009 - 3:48:12 BST

Heheh, you're right again... but in order to get it to work I had to manually add the js code Ruth noted above. That makes it work for forum pages, but note that non-forum pages now have these definitions twice. So something is blocking them from appearing "naturally" on forums pages. The only reason they show up now is that I've manually added them in.

My concern is that there may be other side-effects with this approach.

Re: Error: _menuCloseDelay is not defined


Poster: bobbitt
Dated: Friday April 3 2009 - 1:36:19 BST

As a followup, I made $menuVars global in the PHP page that contains the menu bits, and that solved the problem. No need to add the raw HTML any more.

Thanks!

Re: Error: _menuCloseDelay is not defined


Poster: Ruth
Dated: Friday April 3 2009 - 1:42:23 BST

You're welcome, and thanks much for posting the solution to help others. It is greatly appreciated :)

Ruth