Version 6 Usage Tips

For more information, visit the Advanced Techniques page on our Version 6 site.


Controlling The Vertical Position Of A Floating Menu

Many developers use a floating menu so that the menu remains visible when a page is scrolled. We used a floating vertical menu on the main pages of this site, and we set the top of the menu (the "y" position) at 105 pixels, so that the top of the menu is aligned just below the page header. The problem is, with a normal configuration, the top of the menu will remain at 105 pixels as the page is scrolled; therefore, we used the following solution, which sets the initial "y" coordinate at 105, but changes it to 10 when the menu floats:

1. Select the first menu item in the Menu Tree, go to the Menu Item window, click the round button in the upper right corner, and click Edit Condition. The Item Condition dialog will open.

2. In the Item condition dialog, type the following code in the Prefix text box:

st_cm.y="Math.max(105,stgct()+10)";

Be sure to change 105 to your initial "y" position.


Rick's Tips

Rick has sent me several tips, so I decided to dedicate this section to Rick's tips.

Floating and Static Menus On The Same Page - It is a fairly common practice to have a floating vertical menu on the left side of the page and a static horizontal menu near the top of the page. Rick discovered that menu loading sequence is important: you have to insert the code for the floating menu before the static menu.

Undefined Variable Error - If you are able to use an item condition script, the script may generate an undefined variable error. Until the scripts are re-written for Version 6, an interim solution is to insert:

var xxx; <!-- Substitute the missing variable name for xxx // -->

as the first line in the condition/Prefix: section of the first menu item. This will define the variable for all menu items on the page.