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 verrtical 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_ms[st_cm].mcoy="Math.max(105,stgct()+10)";

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