More Info


You are in: home > javascript > drop down menu tutorial version 2 >
Click here to view the FAQ for this tutorial

dHTML Drop Down Menu Tutorial - Part 5

Some Globals

The menu system will use a number of global variables. Using globals goes against the OOP design, but makes sharing data easier.

The globals are:

// used to hold a timer
var timeOn = null;

// the maximum number of menus in the system 
// (can be increased if necessary)
var numMenus = 50;

// used internally to count the menus defined so far
var currentMenuNo = 0;

// used internally to store whether a menu is active
// or not. Speeds up the system
var menuActive = new Array(numMenus);

// stores which tier the menu is in
var tier = new Array(numMenus);

// used to help line up the menus more accurately
// when borders are enabled
var borderMod = new Array(numMenus);

// the "off" class of the corresponding (sub)menu label link
var offClass = new Array(numMenus);

// the "on" class of the corresponding (sub)menu label link
var onClass = new Array(numMenus);

// the "off" colour of the corresponding (sub)menu label background
var offColours = new Array(numMenus);

// the "on" colour of the corresponding (sub)menu label background
var onColours = new Array(numMenus);

// the name of the bullet object (if any) used
// by the corresponding (sub)menu label
var labelBulletName = new Array(numMenus);

// the type of (sub)menu label corresponding to this menu
// currently can be 'defualt' for a normal menu
// or 'blank'
var menuType = new Array(numMenus);

// an array used to hold the menu objects in the system
var menus = new Array(numMenus);

<< PREVIOUS PAGE: Bullet Points NEXT PAGE: Building the menu bar >>





 © James Austin 2002-05 Web site design by James Austin