Enter a query to search our site. Note that you can use "*" and "?" as wildcards. Enclosing more than one word in double quotes ("CSS Layout") will search for the exact phrase.

Project Seven dot com

PVII Knowledge Base

1. Select a product ...
2. Select category ...
3. Search the Knowledge Base...

Question #92

How can I set the MenuMagic 1 submenus so that they align to the right of the menu buttons, and also align vertically with the top of the menu button, almost like a gliding flyout effect?

The Answer

Prepared Nov. 2002 by Gerry Jacobsen, PVII

Here's how to place the submenu on the right side of the MenuMagic1 menu button:

1. You can set the left postion of the submenu by setting the SubMenu Indent box in the setMenumagic behavior to the width of the button image. This will place the submenu exactly on the right edge of the button.

2. You can adjust a setting inside the MenuMagic1 code to set the vertical position to the top of the button image:

-Locate this line of code in the P7_trigMenuMagic1 function (just past the middle):

if(x==j && tst=="closed"){tsb=th;if(p7m3[j]!=1){th+=P7_getHW('height',d.p7sub);}}p7ms[j]=th;}

-add this small piece of code, right after tsb=th; :

tsb-=P7_getHW('height',p7m[j]);

so the modified line now looks like this:

if(x==j && tst=="closed"){tsb=th;tsb-=P7_getHW('height',p7m[j]);
if(p7m3[j]!=1){th+=P7_getHW('height',d.p7sub);}}p7ms[j]=th;}

Watch the line wrap, this all needs to be on one line in the js code.

That's it, the submenu should now line up to the right of the menu button and vertically with the top of the button. Of course the first line of text will not line up perfectly unless you remove all of the margin and padding from the text link and/or the table in the submenu.

Back to the questions list