Menu Scroll



MenuScroll zip file: MenuScroll.zip

What is MenuScroll? 

MenuScroll  is designed to simulate a windows pop-up menu  (the kind of menu that appears when you right click on your desktop), and is used for site navigation (but with a little imagination it could also be used for presentation). The applet will appear as two menus, the left menu (main) will always be visible and "drive" all the other (sub) menus. 


MenuScroll Error Messages  

The applet is designed to tell you when it's not set up properly by displaying error messages in the browser’s status bar, so please make sure your browser’s status bar is enabled. 

For example, if you get a this or a similar error message: 

error: appletColor value="null" 

this means the applet cannot locate a required parameter, in this case "appletColor". To correct this problem, just add this parameter to the applet code. 

There is one situation in which the applet will not display an error message during a problem. This is when a specified image is not found by the applet. When specifying an image, take care to spell the image name correctly, upper and lower case matter, and put the image in the same directory as the applet class files. While the applet is loading images, it will display the message: loading.... If the applet displays this message for an unusually long time, or finishes loading but does not display the image, this could indicate the applet could not find the image file.


Easy setup 

The easiest way to set up the applet on your page is to use the sample applet code provided in the file MenuScroll.html . Start by copying and pasting the HTML code from this file into your HTML file (from the <applet> to the </applet> tag). Then try it out and customize the parameters for your site. Please make sure that both of the following class files are in the same directory as your HTML file:

  • MenuScroll.class
  • MenuScroller.class

Applet parameters 
 
width and height: 
Change the width and height to indicate the size of the applet. 

windows:  
This parameter names and identifies the applets menus. You may choose any name you want, and enter as many as you want, but make sure each name is separated by a semicolon and there must be a semicolon at the end. Each menu must have a unique name. 
For example: 

<param  name=windows value="msMain;msSub1;msSub2;msSub3;msSub4;msSub5;> 

The above tells the applet that there is 1 main menu named msMain and there are five sub menu's. 
The first menu in this parameter (in the example above, msMain), will be the main menu and will ‘drive’ all other sub menus. 

appletColor:  
This is the background color of the applet. This is usually the same color as your HTML page.

There are two different ways to specify this parameter: by color name, or by RGB value. To use a color name, specify one of the following values:

  • Black
  • blue
  • cyan
  • darkGray
  • gray
  • green
  • lightGray
  • magenta
  • orange
  • pink
  • red
  • white
  • yellow

You may also specify the red, green, and blue values for a unique RGB color. To do so, specify three numbers from 0 - 255, each separated by a comma.

For example, the following will set the color to red:

<param name=appletColor value="255,0,0"> 

mainMenuSize:  
This is the width and height of the main menu (the left menu). 

subMenuHeight:  
This is the height of all the sub menu’s (the right pop up windows). 

Note: 
The sub menu’s width will be calculated by the applet, and will be the difference between the total applet width and the main menu width. 

arrowColor:  
This is the arrow color displayed in the main menu when a sub menu is not selected. The arrow will only be drawn if the link on that line is to a sub menu. Colors supported are the same as the "appletColor" parameter. 

arrowHighliteColor:  
This is the arrow color displayed in the main menu when a sub menu is selected. The arrow will only be drawn if the link on that line is to a sub menu. Colors supported are the same as the "appletColor" parameter. 


Menu parameters 

All the parameters below control individual menu presentation. These parameters must be set up for each menu. For example, if you have 2 menus ALL these parameters must be set up TWICE, once 
for each menu. Precede the parameter with the menu name followed by a dash. For example, if the main menu is called msMain, the "numberOfLines" parameter should be entered like this:

<param name=msMain-numberOfLines value="12"> 

numberOfLines:  
This is the number of lines to display. 

background:  
This is the background color of the menu.

lineSpace:  
This controls how much space is between each line vertically. 

linkFrame:  
This controls which HTML frame to use when a hyperlink is clicked. Use this parameter like the HTML Target attribute. Set the value of this parameter to the name of the frame in which you would like the link to open. You may also specify one of the following standard values:

  • _self   - load in current frame. 
  • _parent - load in parent frame. 
  • _top    - load in topmost frame. 
  • _blank  - load in new unnamed top-level frame. 
scrollSpeed:  
This controls how fast the menu will scroll up and down. Enter a number between 1 and 20. The higher the number the faster it will scroll. 

linkColor:  
This controls the color of the hyperlink line when the mouse is placed over the line. Colors supported are the same as the "appletColor" parameter. 

linkClick:  
This is the number of times to click on a hyperlink line. Use either 1 or  2, for a single or double click. 

image:  
This is the name of the image file used for the menu background. Put the image in the same directory as the applet class file. Take care to spell this correctly, upper and lower case matter. 

imageCenter:  
If using an image, this will center the image in the applet. Enter a yes to center the image. Enter no and the image will not be centered.

Please note, if the image is not centered, and it is smaller than the applet size, then the image will be automatically tiled.

border:  
This parameter indicates what type of border is to be drawn around the menu. Use one of the following:
 

  • line -     draw a one pixel line around the menu. 
  • down - draw a 3d border around the menu that appears lowered. 
  • up   -    draw a 3d border around the menu that appears raised. 
  • no   -    no border around the menu. 
For example, to create a raised border for menu msMain code this: 
<param name=msMain-border value="up">

borderColor: 
The border will be drawn in this color. Colors supported are the same as the "appletColor" parameter. 


Menu default parameters 
 
sizeDefault: 
This is the default text size for each line. 

lineDefault:  
This is the default text that is displayed for each line (usually the default is blank, and this is overwritten). 

colorDefault:  
This is the default color for all lines. Colors supported are the same as the "appletColor" parameter. 

fontDefault:  
This is the default font for all lines. Use one of the following:

Dialog 
Helvetica 
TimesRoman 
Courier 

styleDefault: 
This is the default font style for all lines. Use one of the following:

PLAIN 
ITALIC 
BOLD 

linkDefault:  
This is the default link for all lines (the default is usually blank). Enter as a standard URL:  http://www.consultcom.com 

or 
use a relative link: 
../mypage.html  

or 
This is very important:  
Enter the name of a menu that you wish to pop up when this line is clicked. For example,  if you wish line 3 to link to the sub menu called msSub1, code this: 

<param name=msMain-link3 value="msSub1"> 

lineOffsetDefault:  
This is the default starting position for all lines (starting at position zero). Please note that this parameter does not appley to line separators.


Optional parameters (controls each individual line) 
 
These parameters are basically the same as the default parameters. Just replace the word 'Default' with the line number. For example, to change the default text for the first line of msMain menu, use the parameter 'line1':

<param name=msMain-line1 value="consulting.com, Inc."> 
 
Other line parameters (the line number must appear after the parameter)  
 
separator:  
This will draw a horizontal line separator on the applet. Enter yes or no. For example to draw a line separator on line 2 of msMain menu try this: 
<param name=msMain-separator2 value="yes">