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:41
<div>
Poster: flobadob
Dated: Monday February 19 2007 - 23:41:57 GMT
I have one frame with a <div id="leftmenu"></div> and another frame which will create a menu and stick it into the div. The menu works fine if I hard code it directly into the <div> but when I dynamically alter the div to contain the exact same milonic stuff, the menu is not displayed. I use the firebug plugin for firefox to debug this (excellent plugin by the way) and I notice that coding the menu directly gives...
Code:
<frame scrolling="no" src="/leftframe.mas" noresize="" name="leftframe">
<html>
<head>
</head>
<body bgcolor="#cfe2d1">
<div id="leftmenu">
<script type="text/javascript">
1
2var left_menu=new menuname("left_menu");
3left_menu.style=vertStyle;
4left_menu.top=50;
5left_menu.left=0;
6left_menu.itemwidth=127;
7left_menu.alwaysvisible=1;
8left_menu.aI("text=blob;url=http://www.bbc.co.uk;");
9drawMenus();
10
</script>
<div id="menu0" class="mmenu" style="border-style: solid; border-color: rgb(255, 255, 255) rgb(54, 126, 69) rgb(54, 126, 69) rgb(255, 255, 255); border-width: 1px; padding: 0px; background: rgb(97, 167, 109) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; z-index: 999; visibility: visible; position: absolute; top: 50px; left: 0px;" onselectstart="return 0" onmouseover="$J(0)" onmouseout="$I()">
</div>
</div>
</body>
</html>
</frame>
<html>
<head>
</head>
<body bgcolor="#cfe2d1">
<div id="leftmenu">
<script type="text/javascript">
1
2var left_menu=new menuname("left_menu");
3left_menu.style=vertStyle;
4left_menu.top=50;
5left_menu.left=0;
6left_menu.itemwidth=127;
7left_menu.alwaysvisible=1;
8left_menu.aI("text=blob;url=http://www.bbc.co.uk;");
9drawMenus();
10
</script>
<div id="menu0" class="mmenu" style="border-style: solid; border-color: rgb(255, 255, 255) rgb(54, 126, 69) rgb(54, 126, 69) rgb(255, 255, 255); border-width: 1px; padding: 0px; background: rgb(97, 167, 109) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; z-index: 999; visibility: visible; position: absolute; top: 50px; left: 0px;" onselectstart="return 0" onmouseover="$J(0)" onmouseout="$I()">
</div>
</div>
</body>
</html>
</frame>
note that there is a div id=menu0 here, but when i add the menu dynamically i get this...
Code:
<frame scrolling="no" src="/leftframe.mas" noresize="" name="leftframe">
<html>
<head>
</head>
<body bgcolor="#cfe2d1">
<div id="leftmenu">
<script type="text/javascript">
1var left_menu=new menuname("left_menu");
2left_menu.style=vertStyle;
3left_menu.top=50;
4left_menu.left=0;
5left_menu.itemwidth=127;
6left_menu.alwaysvisible=1;
7left_menu.aI("text=floobs;url=http://www.bbc.co.uk;");
8drawMenus();
9
</script>
</div>
</body>
</html>
</frame>
<html>
<head>
</head>
<body bgcolor="#cfe2d1">
<div id="leftmenu">
<script type="text/javascript">
1var left_menu=new menuname("left_menu");
2left_menu.style=vertStyle;
3left_menu.top=50;
4left_menu.left=0;
5left_menu.itemwidth=127;
6left_menu.alwaysvisible=1;
7left_menu.aI("text=floobs;url=http://www.bbc.co.uk;");
8drawMenus();
9
</script>
</div>
</body>
</html>
</frame>
which does not have the (presumably all important div id=menu0. Any ideas??
thanks,
Kristian.