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:13
Two menus in the same table cell
Poster: fpajot
Dated: Tuesday September 9 2003 - 15:53:09 BST
Hello,
I have a problem with Relative Positioning (Table Bound)
I want to put two menus in the same cell of table, but that does not
function.
The two menus are one below the other, whereas they should be
superimposed.
I want to then use the function "menuDisplay" to hide one or the other
finely.
That functioned with the "PlaceMenu" of the preceding version.
Here is the code :
STYLES -->
<script language=JavaScript>
with(StyleOn=new mm_style()){
offbgcolor="#b71812";
offcolor="#ffffff";
onbgcolor="#DAD8D8";
oncolor="#b71812";
bordercolor="#ffffff";
borderstyle="solid";
borderwidth=0;
separatorcolor="#ffffff";
separatorsize="1";
padding=2;
align="center";
fontsize="9";
fontstyle="normal";
fontfamily="verdana";
fontweight="bold";
pagecolor="black";
pagebgcolor="#82B6D7";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="";
subimagepadding="2";
}
with(StyleOff=new mm_style()){
offbgcolor="#dad8d8";
offcolor="#ffffff";
onbgcolor="#dad8d8";
oncolor="#ffffff";
bordercolor="#f2f2f2";
borderstyle="solid";
borderwidth=1;
separatorcolor="#ffffff";
separatorsize="1";
padding=2;
align="center";
fontsize="9";
fontstyle="normal";
fontfamily="verdana";
fontweight="bold";
pagecolor="black";
pagebgcolor="#82B6D7";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="";
subimagepadding="2";
}
drawMenus();
</script>
--> HTML
<table width="100%" border="1" cellspacing="1" cellpadding="0">
<tr><td>ligne1</td></tr>
<tr>
<td width=50>
<script language=JavaScript>
with(milonic=new menuname("menufp1")){
top=10;
left=100;
style=StyleOn;
orientation="horizontal";
alwaysvisible=1;
position="relative";
aI("text=ON;url=index_abo.htm;target=_top");
}
with(milonic=new menuname("menufp2")){
top=10;
left=100;
style=StyleOff;
orientation="horizontal";
alwaysvisible=1;
position="relative";
aI("text=OFF;url=index_abo.htm;target=_top");
}
drawMenus();
</script>
</td>
</tr>
<tr><td>ligne3</td></tr>
</table>
Any ideas ?
Poster: Maz
Dated: Tuesday September 9 2003 - 19:09:53 BST
I use the method of only placing the menu script in the table, leave the source script where it is in the header or body.
I have an idea that you will still get one menu after the other.
If you search you will find my other post asking about changing menu on login.
Regards
maz
Poster: Hergio
Dated: Wednesday September 10 2003 - 3:05:19 BST
First, you have drawMenus called twice...you dont need that in this case. Secondly, you should put your menu definitions back into your menu_data file and then inside of the <TD> tag in your table, put the <SCRIPT src="menu_data.js"></SCRIPT> line.
Poster: fpajot
Dated: Wednesday September 10 2003 - 8:02:56 BST
I put the menu definition in a menu_data file and the <script src="menu_data.js></script> in the <td>tag.
That gives the same result.
the menu "ON" is with the top of the menu "OFF" whereas it should be
superimposed.
F.PAJOT
Web Application Developer
__________________________________________________________
The menu_data.js :
_menuCloseDelay=500 // The time delay for menus to remain visible on mouse out
_menuOpenDelay=150 // The time delay before menus open on mouse over
_followSpeed=5 // Follow scrolling speed
_followRate=40 // Follow scrolling Rate
_subOffsetTop=10 // Sub menu top offset
_subOffsetLeft=-10 // Sub menu left offset
_scrollAmount=3 // Only needed for Netscape 4.x
_scrollDelay=20 // Only needed for Netcsape 4.x
with(StyleOn=new mm_style()){
offbgcolor="#b71812";
offcolor="#ffffff";
onbgcolor="#DAD8D8";
oncolor="#b71812";
bordercolor="#ffffff";
borderstyle="solid";
borderwidth=0;
separatorcolor="#ffffff";
separatorsize="1";
padding=2;
align="center";
fontsize="9";
fontstyle="normal";
fontfamily="verdana";
fontweight="bold";
pagecolor="black";
pagebgcolor="#82B6D7";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="";
subimagepadding="2";
}
with(StyleOff=new mm_style()){
offbgcolor="#dad8d8";
offcolor="#ffffff";
onbgcolor="#dad8d8";
oncolor="#ffffff";
bordercolor="#f2f2f2";
borderstyle="solid";
borderwidth=1;
separatorcolor="#ffffff";
separatorsize="1";
padding=2;
align="center";
fontsize="9";
fontstyle="normal";
fontfamily="verdana";
fontweight="bold";
pagecolor="black";
pagebgcolor="#82B6D7";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="";
subimagepadding="2";
}
with(milonic=new menuname("menufp1")){
top=10;
left=100;
style=StyleOn;
orientation="horizontal";
alwaysvisible=1;
position="relative";
aI("text=ON;url=index_abo.htm");
}
with(milonic=new menuname("menufp2")){
top=10;
left=100;
style=StyleOff;
orientation="horizontal";
alwaysvisible=1;
position="relative";
aI("text=OFF");
}
drawMenus();
__________________________________________________________
The html file :
<html>
<head>
<title>TEST</title>
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
</head>
<body id="bodytop" leftmargin="0" topmargin="0">
<table width="100%" border="1" cellspacing="1" cellpadding="0">
<tr><td>ligne1</td></tr>
<tr>
<td>
<SCRIPT language=JavaScript src="javascript/menu_data.js" type=text/javascript></SCRIPT>
</td>
</tr>
<tr><td>ligne3</td></tr>
</table>
</body>
</html>