mouse over first submenu breaks in IE only

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
iolog
Beginner
Beginner
Posts: 1
Joined: Tue Feb 14, 2006 9:38 pm
Contact:

mouse over first submenu breaks in IE only

Post by iolog »

Hello,

I'm encountering an IE only problem with the menu system.

When you mouse over the first (the first one added) sub-menu, a javascript error is thrown. In Firefox and Opera, there is no issue.

It doesn't seem to have anything to do with the content of the menu, as I have re-arragned items randomly.

Link to site:

http://www.certicom.com/index.php?action=test,milonic

In the above case, Going to Company --> Executives throws a JS error. But going to any other menu item doesn't. I have tried removing executives, in which case "Investors" throws the error.

Because the menu is generated dynamically from CMS content, it's a little difficult to post the JS code which creates the menu, but essentailly it looks something like this (using the PHP api):

Any help would be appreciated.

Code: Select all

function buildLocs($locs,$parentID,$depth){


	$mmMenu=new mMenu();
	if ( $depth == 1 ){

		$mmMenu->style="menuStyle";
		$mmMenu->alwaysvisible="true";
		$mmMenu->orientation="horizontal";
		$mmMenu->position="relative";
		$mmMenu->itemheight="21";				
	}
	else $mmMenu->style = "submenuStyle";


	foreach($locs as $l){

		// URL code excluded..
		$url = 'the url';
		
		if ($depth == 1) $title = strtoupper($l->title);
		else $title = $l->title;

		$title = $title . " ";


		if ( $l->locations && $depth < 3 ) $mmMenu->addItemFromText("showmenu=id_$l->id;text=$title;url=$url;");
		else $mmMenu->addItemFromText("text=$title;url=$url;");
	}
	
	$mmMenu->createMenu("id_".$parentID);		

	if ($depth < 3){			
		$nextDepth = $depth+1;
		foreach($locs as $l){
			if ($l->locations) buildLocs($l->locations,$l->id."",$nextDepth);
		}
	}


}
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi

the menu is positioned relative in a table cell. To do it correct, please follow suggestions given here

http://milonic.com/forum/viewtopic.php?t=6527


compare with the code your code-generator has created.


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

Post by Andy »

Looks as though it's working, is it OK now?
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi

the "menustyle.." too should be part of that js menu code which contains the subs and the submenuStyle (after the body tag), whereas the table cell has to contain the mainmenu only with its own drawMenus() !

Michael
Post Reply