I downloaded a copy of the DHTML Menu sample number 9 Relative Positioning (Table Bound) which works fine when I view it on the Milonic website, but when I look at the menu.htm that I've downloaded, the dropdown menu for "Menu Samples" doesn't work (ie no menu items appear below it) and the same thing happens when I try to customise it for my own use. It doesn't matter how I order the menus or what their content, the first one always doesn't work.
I know it's nothing I've done because this is viewing the file, as downloaded, from the Milonic site, with all the relevant .js files in place.
Anyone know what the trouble might be?
Problem with Menu Sample 9
I'm not sure we're looking at the same file. My menu.htm reads like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
BODY
{FONT-FAMILY:verdana;
background-color:#FFFFFF;
}
.backG {
FONT-FAMILY:verdana;
background-color:#93c39b;
color:#ffffff;
border-bottom:#538c4d 2px solid;
font-size:120%;
}
</style>
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript src="menu_data.js" type=text/javascript></SCRIPT>
</head>
<body>
<table width=100% cellSpacing=0 cellPadding=13 border=0 style="border:1px solid #aaaaaa">
<tr>
<td class=backG align=center>
<b>Relative Positioning (Table Bound)</td>
</tr>
<tr>
<td class=form1>
<table border=1 width=100%>
<tr>
<td>
Left Aligned Table Cell
</td>
</tr>
<tr>
<td align=center style="font-size:125%">
Center Aligned Table containing the menu
<script>
with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=155;
left=200;
alwaysvisible=1;
orientation="horizontal";
position="relative";
aI("text=Home;url=http://milonic.com/;status=Back To Home Page;");
aI("text=Menu Samples;showmenu=Samples;");
aI("text=Milonic;showmenu=Milonic;");
aI("text=Partners;showmenu=Partners;");
aI("text=Links;showmenu=Links;");
aI("text=My Milonic;showmenu=My Milonic;");
}
drawMenus();
</script>
</td>
</tr>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
BODY
{FONT-FAMILY:verdana;
background-color:#FFFFFF;
}
.backG {
FONT-FAMILY:verdana;
background-color:#93c39b;
color:#ffffff;
border-bottom:#538c4d 2px solid;
font-size:120%;
}
</style>
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript src="menu_data.js" type=text/javascript></SCRIPT>
</head>
<body>
<table width=100% cellSpacing=0 cellPadding=13 border=0 style="border:1px solid #aaaaaa">
<tr>
<td class=backG align=center>
<b>Relative Positioning (Table Bound)</td>
</tr>
<tr>
<td class=form1>
<table border=1 width=100%>
<tr>
<td>
Left Aligned Table Cell
</td>
</tr>
<tr>
<td align=center style="font-size:125%">
Center Aligned Table containing the menu
<script>
with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=155;
left=200;
alwaysvisible=1;
orientation="horizontal";
position="relative";
aI("text=Home;url=http://milonic.com/;status=Back To Home Page;");
aI("text=Menu Samples;showmenu=Samples;");
aI("text=Milonic;showmenu=Milonic;");
aI("text=Partners;showmenu=Partners;");
aI("text=Links;showmenu=Links;");
aI("text=My Milonic;showmenu=My Milonic;");
}
drawMenus();
</script>
</td>
</tr>
I was looking at this page
http://www.milonic.co.uk/menusample.php?sampleid=9
<SCRIPT language=JavaScript src="/milonic_src.js" type=text/javascript>
<SCRIPT language=JavaScript src="/menu_data.js" type=text/javascript>
missing the </script>
You don't have the slash /milonic_src.js
(I'm not sure about style.css on the same page, but normally in a style page they have to be in a certain order, color comes first.)
Is there an
</table>
</body>
</html>
or did you not show that here?
If the end is missing perhaps you should try another download.
I haven't worked with table bound so I may not have all the answers you are looking for.
http://www.milonic.co.uk/menusample.php?sampleid=9
<SCRIPT language=JavaScript src="/milonic_src.js" type=text/javascript>
<SCRIPT language=JavaScript src="/menu_data.js" type=text/javascript>
missing the </script>
You don't have the slash /milonic_src.js
(I'm not sure about style.css on the same page, but normally in a style page they have to be in a certain order, color comes first.)
Is there an
</table>
</body>
</html>
or did you not show that here?
If the end is missing perhaps you should try another download.
I haven't worked with table bound so I may not have all the answers you are looking for.
I think this is a bug in the menu....but try copying the first menu declaration in the file and pasting it above itself, then rename it. Dont make any other menus show it (reference it) but just the fact that menu samples is no longer the first menu declared in code clears up the problem. Not sure why.
And maz, in the code on the sample page, the closing script tags are actually there (they are also in the download version) but they didnt render because when whomever created the page (not pointing fingers) they didn't escape the <SCRIPT> tag and the browser renders it. Take a look at the source for the page, they're there. When you want strings like "<SCRIPT>" and "</SCRIPT>" to show up in HTML, you need to escape the > and < symbols or break up the word 'script'.
And maz, in the code on the sample page, the closing script tags are actually there (they are also in the download version) but they didnt render because when whomever created the page (not pointing fingers) they didn't escape the <SCRIPT> tag and the browser renders it. Take a look at the source for the page, they're there. When you want strings like "<SCRIPT>" and "</SCRIPT>" to show up in HTML, you need to escape the > and < symbols or break up the word 'script'.
Dave Hergert
Software Engineer
"Helping to make the menu better, one
at a time."
Software Engineer
"Helping to make the menu better, one

Yeah, that did it. I'd actually come up with a similar (but far more clumsy) work around in the meantime - now I've tidied up.Hergio wrote:I think this is a bug in the menu....but try copying the first menu declaration in the file and pasting it above itself, then rename it. Dont make any other menus show it (reference it) but just the fact that menu samples is no longer the first menu declared in code clears up the problem. Not sure why.

- stephen702
- Super Advanced
- Posts: 77
- Joined: Wed Jul 16, 2003 4:53 am
- Location: Davis, CA
- Contact:
Bug in menu sample 9
Here's another oddity:
The online sample of #9 works fine with Netscape 4.7 on the PC. But none of the drop-menus work in the downloaded version when using 4.7.
The online sample of #9 works fine with Netscape 4.7 on the PC. But none of the drop-menus work in the downloaded version when using 4.7.
John G. posted a good fix to the problem here http://milonic.com/forum/viewtopic.php?t=2352#8057. Basically it intails putting the all the menu code back into menu_data and then referencing the <SCRIPT src="..."></SCRIPT> inside the td you want the menu to appear in. Check it out.
Dave Hergert
Software Engineer
"Helping to make the menu better, one
at a time."
Software Engineer
"Helping to make the menu better, one

-
- Beginner
- Posts: 8
- Joined: Tue Aug 19, 2003 1:54 am
[quote="Hergio"]I think this is a bug in the menu....but try copying the first menu declaration in the file and pasting it above itself, then rename it.
...
like this:
with(milonic=new menuname("workaround")){
style=menuStyle;
aI("text=Product Purchasing Page;url=http://milonic.com/cbuy.php;");
aI("text=Contact Us;url=http://milonic.com/contact.php;");
aI("text=Newsletter Subscription;url=http://milonic.com/newsletter.php;");
}
with(milonic=new menuname("Details")){
style=menuStyle;
aI("text=Product Purchasing Page;url=http://milonic.com/cbuy.php;");
aI("text=Contact Us;url=http://milonic.com/contact.php;");
aI("text=Newsletter Subscription;url=http://milonic.com/newsletter.php;");
..
and it works, for anyone else looking for the answer.
...
like this:
with(milonic=new menuname("workaround")){
style=menuStyle;
aI("text=Product Purchasing Page;url=http://milonic.com/cbuy.php;");
aI("text=Contact Us;url=http://milonic.com/contact.php;");
aI("text=Newsletter Subscription;url=http://milonic.com/newsletter.php;");
}
with(milonic=new menuname("Details")){
style=menuStyle;
aI("text=Product Purchasing Page;url=http://milonic.com/cbuy.php;");
aI("text=Contact Us;url=http://milonic.com/contact.php;");
aI("text=Newsletter Subscription;url=http://milonic.com/newsletter.php;");
..
and it works, for anyone else looking for the answer.