Skip to main content

Application Variables

The variables are divided into four groups: DHTML layer defaults, Browser-determined variables, Image-related variables and Autopilot-related variables.

The image-related variables consist of arrays that will manage the images. Check out lines 25-28:

 
var img = new Array();
var imgOut = new Array();
var imgOver = new Array();
var imgPath = 'images/';
 

These are fairly straightforward. The images stored in the img array represent the slide images. Those stored in the imgOut array are used as the slide menu images. The images stored in the imgOver array are used for the menu rollover images.

The last variable, imgPath, contains the value of the path to where all the images are kept on your web server. You can make this path absolute or relative. An absolute path contains the entire location of files, from the host and domain name or IP address of the web server or local drive (such as C:\) to the directory containing the files. Here are two examples.

 
var imgPath = 'http://www.serve.com/hotsyte/';
var imgPath = 'C:\\Winnt\\Profiles\\Administrator\\Desktop\\';
 

You'll have to use two backslashes (\\) to produce a single escaped backslash with any Windows OS. If you don't, JavaScript will think you mean: C:WinntProfilesAdministratorDesktop. That's not only wrong, it's a syntax error.

The last two variables, showSpeed and tourOn, represent the speed at which the slides change and whether the autopilot is on. Here they are at lines 30-31:

 
var showSpeed = 3500;
var tourOn = false;
 

Variable showSpeed is expressed in milliseconds. You can increase the time between changes, to say, 10 seconds by setting it to 10000, for slides with more information. You can also make it blindingly fast by setting it to, say, 10. When the page first loads, the automated slideshow isn't on. So, tourOn, is set to false.

Next: The Application Functions