6

Dec 10

Anchor the Floating Menu in the Center

If the window is full screen, positioning the menu in the center is easy; if not, you can see the samples, which keeps the menu in the center.

http://www.sothink.com/product/dhtmlmenu/store/floatcenter/floatingcenter.htm

The sample can be remained with users as scrolling the page. The location of menu always lies in the center according to the page size. This is a special alignment pattern of floating menu.

Steps:

  • Click Global > Menu Type, select Float in Menu Type.
  • Choose the first menu item, and click Condition in Menu Item.
  • Enter the responding code below into the Prefix in Condition.
    Center Horizontally
    _STNS._aStMenus[_STNS._aStMenus.length-1].iX=”Math.max(stgcl()+parseInt(_STNS.fiGetCW()/2-_STNS.fiGetEleWid(_STNS.fdmGetEleById(_STNS._aStMenus[_STNS._aStMenus.length-1].aPopups[0].sUid))/2),0)”;
  • If you want to set menu alignment as Center Vertically:
    _STNS._aStMenus[_STNS._aStMenus.length-1].iY=”Math.max(stgct()+parseInt(_STNS.fiGetCH()/2-_STNS.fiGetEleHei(_STNS.fdmGetEleById(_STNS._aStMenus[_STNS._aStMenus.length-1].aPopups[0].sUid))/2),0)”