|
home / samples / permanent menus
Permanent Menus

Permanent Menus (IsPermanent equals
true) have a single unique property that is not shared by any other menu: Once they
are displayed, they remain visible as long as the HTML page they are within is loaded.
Thus, a better name for "Permanent Menus" would be "Permanently Displayed Menus," and indeed,
that is how we refer to them in much of our documentation. Do not confuse permanently displayed
menus with Fixed Position / Reposition On Scroll menus; to set
a menu's IsPermanent flag says nothing, in and of itself, about how the menu
will be positioned on the page. Permanent menus are typically created in conjunction
with the CreateOnLoad parameter;
i.e., typically when you define a permenently displayed menu you will also set its
CreateOnLoad parameter to true, so that it is guaranteed to be created
and displayed as soon as the HTML page is finished loading.
To position permanent menus, you will typically use the
TopMenuX and
TopMenuY parameters. These, and many
other facets of menu positioning are covered in the
Menu Positioning Mini-Tutorial.
On this page, we've placed two permanently displayed menus: A horizontal menu, that is
located near the top of the page, and a vertical menu to the left of this paragraph. In each
case, we used the TopMenuX/Y parameters in conjunction with the
HM_F_GetElementXY function provided in the
version 6 loader file to load the menu at the same position as an image that we included
within the HTML. Additionally, we hooked the
HM_OnMenuCreated menu event
hook to adjust the size of those images to match the size of the menus after the menus
were created (a trick which works properly only in the later browsers). See the
Menu Event Hooks mini-tutorial
for further information.
Other properties to watch out for in conjunction with permanently displayed menus
are ScrollEnabled and
TopKeepInWindowX/TopKeepInWindowY.
If you do not set these parameters properly, you may find that your permanently visible
menus generate scroll bars if they cannot fit within the browser window and/or are
automatically repositioned to be within the browser window if their TopMenuX/Y
settings would have them placed off screen.
Finally, put some thought into whether you really need to use permanently visible
menus or not. If your navigation scheme is based solely on a main permanently visible
menu, then those users that visit your site with older browsers that HierMenus does
not support and/or browsers in which the user has intentionally disabled JavaScript
will see no menus at all (HierMenus is JavaScript based; and therefore requires
that JavaScript be enabled in the browser to run properly). Therefore you should use
permanently visible menus only in very tightly controlled environments, (such as
a corporate intranet or something of the like) where you can be sure that your users
have JavaScript enabled, HierMenus compatible browsers. Otherwise, creating
popup menus is a better choice, since it allows your
JavaScript disabled browsers to follow your in-page links even though the menus are
not displayed.
Click the link below to have a look at the configuration file we used to generate
these sample menus:
perm.js
|