(c) Dynarch.com 2003-2005.
All Rights Reserved.
NavBar is designed and implemented by mishoo with the same dedication and care for details that he has put in all his projects.
Preferences



How to set preferences

NavBar supports some customization by changing the properties of the “prefs” member object. You can read the full list of properties in customize.html.

There are some particular things to be discussed about certain preferences. NavBar automatically saves certain preferences in a cookie--such as "auto-hide", "mono-section", or even the current section number. For this reason, if you want to make sure that they have a certain value you should set them after the call to menu.generate(). As well, there are other prefs--such as "no-controls"--which must be set before the call to menu.openMenu(), or otherwise they won't have effect.

Here's an example for setting certain prefs:

  var menu = new NavBar("content");
  menu.prefs["no-controls"] = true;
  // open the menu now, without controls
  menu.openMenu();
  new NavSection(menu, ...);
  // ...
  menu.generate();
  // the following prefs are restored from cookie at generate()
  // so we'd better set them here, just in case.
  menu.prefs["tooltips"] = false;
  menu.prefs["ns-frames"] = 50; // really slow animation

Another example is how to set the link in the control bar. Same as "no-controls", these preferences must be set before the call to openMenu() because otherwise they won't be present in the first control bar:

  var menu = new NavBar(...);
  menu.prefs["home-href"] = "http://www.dynarch.com/";
  menu.prefs["home-title"] = "Home";
  menu.prefs["home-text"] = "home";
  menu.openMenu();
  ...