 |
|
We are providing HierMenus to you at no cost. HierMenus code requires a confirmed membership with internet.com. Please register by clicking here and come back soon to download your free copy of HeirMenus code.
|
|
 |

|
 |
 |
|
home / documentation / reference / hm_onmove
HM_OnMove
- Description:
- The custom (user defined) method that is called whenever HierMenus is
about to move a menu.
- Value:
- JavaScript function.
- Applies To:
- Menus.
- Browser Compatibility:
- HM_OnMove is supported in all browsers.
- Parameters:
- (menuEl,xPos,yPos)
menuEl is the HTML element for the menu
xPos is the x (left) pixel location that
the menu is about to be moved to. xPos is passed as an
integer.
yPos is the y (top) pixel location that
the menu is about to be moved to. yPos is passed as an
integer.
- Comments:
- HM_OnMove is a HierMenus Menu Event Hook; a
means for you to execute your own custom JavaScript code from within normal
HierMenus processing. All menu event hooks expect to be set to the name of
a custom function (typically of your own creation, although the HM_Loader.js
file contains some custom functions designed for use with event hooks), a
function literal, or a dynamically generated function.
The function you create for use with this menu event hook should be designed
as a method of the menu object, i.e., the internal menu object that HierMenus
creates to track the various unique parameters of the menu itself. Thus, the
this keyword, within the context of your custom function, refers
directly to the menu object.
The menu object (referred to by this) is not the
same as the menu element. The menu object is the internal structure
that HierMenus uses to track various pieces of information specific to this
menu. The menu element is the actual HTML page element that represents
the menu itself. You access the menu object via the this keyword
within your custom method; you access the menu element via the first parameter
passed to the function.
When using HM_OnMove note that it is not guaranteed
that the action that is being called for is strictly necessary on the menu.
For example, HierMenus may call for a menu to be moved to a location when,
in fact, it is already at that location. If strict adherence to actual menu
movement is necessary for your use, then you may wish to check the current
location of the menu element before proceeding with your function.
For further usage and implementation information, see the mini-tutorial
Menu Event Hooks.
- Example Method:
// write a message to the status bar
// describing the movement of a menu
function HM_fc_MenuMove(menuEl,xPos,yPos) {
window.status="Moving "+this.MenuID+" to ("+xPos+","+yPos+")";
}
- Example Settings:
// Ok:
HM_OnMove:HM_fc_MenuMove,
HM_OnMove:null, // remove hook for this menu
// Incorrect:
HM_OnMove:"HM_fc_MenuMove",
// do not quote function names here
HM_OnMove:"null",
// do not quote null here
- Default:
- null
- See Also:
-
HM_OnVisibilityToggle,
HM_OnCreateMenu,
HM_OnMenuCreated,
HM_OnItemHilite,
HM_OnBuildMenus,
HM_OnItemClick,
HM_OnItemHover,
HM_OnCreateItem,
HM_OnItemCreated,
HM_OnMenuOver,
HM_OnMenuOut,
HM_OnItemOver,
HM_OnItemOut,
HM_OnLink,
setTrans,
killTrans,
Menu Event Hooks Mini-Tutorial
|
|