NavBar animation
NavBar supports several levels of animation and they can be set using the “prefs” object:
- menu.prefs["animation"] = 0; -- this will disable all animation
- menu.prefs["animation"] = 1; -- this will enable section-level animation (only when expand/collapse sections)
- menu.prefs["animation"] = 2; -- this will enable NavBar-level animation (NavBar hide/show is also animated)
- menu.prefs["animation"] = 3; -- this will enable page-level animation (NavBar hide/show also animates page content resizing)
Animation speed can be further controlled by 4 configuration variables, also accessible through the “prefs” object:
- ns-frames -- number of frames for section animation
- ns-fps -- number of frames per second for section animation
- nb-frames -- number of frames for NavBar animation
- nb-fps -- number of frames per second for NavBar animation
The “*-frames” variables can be numeric, in which case the animation time will be equal regardless of section height, or they can be the string "auto". If "auto" is passed (this is also the default) then NavBar will compute the number of frames dinamically based on number of items present in each section. This is the nicest animation, in our opinion, but for very long sections it may lead to slow animation which isn't desirable.
For experimentation, using the form below you can change the animation parameters for the NavBar present in this page. To restore the default values just refresh this page (NavBar won't save these variables).
menu.prefs["ns-frames"] = | |
menu.prefs["ns-fps"] = | |
menu.prefs["nb-frames"] = | |
menu.prefs["nb-fps"] = |