Menu Loaded/onLoad switch?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
TypicalHuman
Beginner
Beginner
Posts: 5
Joined: Fri Jan 28, 2005 9:18 pm

Menu Loaded/onLoad switch?

Post by TypicalHuman »

I'm having a problem on http://www.ironwoodadvisory.com when user manages to call popup() function or something like that before menu is loaded. (Resulting in Object expected error to appear)

I know that a 200ms delay would probabally work, but seems pretty hack to me.

Is there a global variable that is defined as soon as the menu is loaded, or do I have to do something like wrap the popup() function with an onload switch?

Thanks!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

There is a buildAllMenus parameter which is a global property and goes up at the top. Menu Quick Reference Guides - Global Properties The explanation is about half-way down. There is also a preloadmenuimages.js module.

Ruth
TypicalHuman
Beginner
Beginner
Posts: 5
Joined: Fri Jan 28, 2005 9:18 pm

Post by TypicalHuman »

Hmm, your answer doesn't seem to address the problem I'm having.

Problem: If a user tries to drop down a menu before the menu is finished loading, I get an Object Expected error. User drops menu by rolling over an image that calls popup() onmouseover.

Like I said, I'd guess the error is because the user can call popup() function before it is defined (by loading the .js include files).

Is there any way, other than wrapping that function, that I can prevent this from happening?
TypicalHuman
Beginner
Beginner
Posts: 5
Joined: Fri Jan 28, 2005 9:18 pm

Post by TypicalHuman »

Ok, seems like the answer was the ignoreCollisions = true; config.

Not really sure what a "collision" is or how it is caused though, any thoughts?
TypicalHuman
Beginner
Beginner
Posts: 5
Joined: Fri Jan 28, 2005 9:18 pm

Post by TypicalHuman »

Ha, living up to my name .. I tricked myself. Same problem, start again.
TypicalHuman
Beginner
Beginner
Posts: 5
Joined: Fri Jan 28, 2005 9:18 pm

Post by TypicalHuman »

Got it .. problem was that somehow the javascript had ended up in the body tag below images and href that I use to drop the submeuns.

I moved the .js includes into the head and now cannot reproduce the problem (i.e. fixed).

-e
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Glad you got it fixed. Sorry, if I misunderstood. I thought that having buildAllMenus would mean that the menu wouldn't be available until all of it was there.... :?

Ruth
Post Reply