Error: _menuCloseDelay is not defined

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
bobbitt
Advanced
Advanced
Posts: 17
Joined: Thu Mar 12, 2009 4:43 pm

Error: _menuCloseDelay is not defined

Post by bobbitt »

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: Select all

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
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Re: Error: _menuCloseDelay is not defined

Post by John »

Using IE7 and FF3.0.8, I'm having no trouble seeing the dropdowns in your forum area.
John
bobbitt
Advanced
Advanced
Posts: 17
Joined: Thu Mar 12, 2009 4:43 pm

Re: Error: _menuCloseDelay is not defined

Post by bobbitt »

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
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Error: _menuCloseDelay is not defined

Post by Ruth »

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: Select all

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
bobbitt
Advanced
Advanced
Posts: 17
Joined: Thu Mar 12, 2009 4:43 pm

Re: Error: _menuCloseDelay is not defined

Post by bobbitt »

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: Select all

$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!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Error: _menuCloseDelay is not defined

Post by Ruth »

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://milonic.com/support/

Ruth
bobbitt
Advanced
Advanced
Posts: 17
Joined: Thu Mar 12, 2009 4:43 pm

Re: Error: _menuCloseDelay is not defined

Post by bobbitt »

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

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

Re: Error: _menuCloseDelay is not defined

Post by John »

Using the new link you provided, IE8 and FF3.0.8 I am still able to see all menus in the forum area.
John
bobbitt
Advanced
Advanced
Posts: 17
Joined: Thu Mar 12, 2009 4:43 pm

Re: Error: _menuCloseDelay is not defined

Post by bobbitt »

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.
bobbitt
Advanced
Advanced
Posts: 17
Joined: Thu Mar 12, 2009 4:43 pm

Re: Error: _menuCloseDelay is not defined

Post by bobbitt »

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!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Error: _menuCloseDelay is not defined

Post by Ruth »

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

Ruth
Post Reply