|
|
Introduction
Normally, when you use a floating menu, its position is fixed relatively to the screen. Here is an example of floating menu, whose position is fixed relatively to a table and does not change when the window is resized, (but the menu still scrolls along with the scrolling page).
Steps
- Create a floating menu by checking Float in Menu Type of Global.
- In the DHTML Menu program, select the first menu item under the Top-Level Menu in the Menu Tree, click "Condition" in "Menu Item". In the suffix, input the following:
function stgtxy()
{
var x=0,y=0;
for(var o=_STNS.fdmGetEleById("stTABLE");o;o=o.offsetParent)
{
x+=parseInt(o.offsetLeft);
y+=parseInt(o.offsetTop);
}
return [x,y];
}
_STNS._aStMenus[_STNS._aStMenus.length-1].iX="stgtxy()[0]";
_STNS._aStMenus[_STNS._aStMenus.length-1].iY="stgtxy()[1]+stgct()";
- Add the menu to a page where there is a table.
- Set the ID of the table cell (TD) that the floating menu alighns to stTABLE, like <td width="210" id="stTABLE">
|