Introduction
This command reference lists the commands that are contained in the core module of the overLIB plugin utility (see the file plugin_description.html for a descirption of the rationale and the approach taken to achieve this capability). This module contains most of the functionality that was present in versions 3.50 & 3.51, with the exception of the styling commands. The CSSCLASS Commands are now part of the core module and the CSSSTYLE Commands have been placed in its own plugin (see the documentation for CSSSTYLE Commands). Some additional features that are felt to important have been included in the core module. To make use of these commands, you need to insert the following line in your HEAD section:
<SCRIPT TYPE="text/javascript" SRC="overlib.js"></SCRIPT>
This statement must be included with all of the other plug-in modules and must come first. The other plugins can then be loaded in any order that you want.
Remember that commands are always in uppercase (case-sensitive) and can have none or more parameter values.
Download this module as a zip file.
There are multiple ways to customize overLIB and using a long command line to invoke overLIB is NOT the recommended way of calling overLIB. The suggested method for customizing overLIB is to use one of the following three approaches:
- Make the changes that you want in the default variables themselves. The default variables are those that are prefaced with ol_ and are located near the beginning of each module. This approach, of course, means that you are modifying the overLIB code.
- Define your default variables in a separate Javascript
block like this:
<SCRIPT TYPE="text/javascript"> <!-- var ol_width=300; var ol_fgcolor='#ffffcc'; var ol_bgcolor='#666666'; //--> </SCRIPT>
This block can come either before or after the core module is loaded as long as you are not setting either theol_texts
and/orol_caps
arrays. If these are being set, then you'll have to place this code block after the core module loads. - The approach that is recommended for those who are uncomfortable
making changes in the code or are not that familar with
Javascript is to use the overlib_pagedefaults routine
that is in the core module. I recommend that this routine
be called by placing the following little script block after
the core module loads (or after all modules load if you're
also specifying parameters that are pertinent to those modules):
<SCRIPT TYPE="text/javascript"> <!-- overlib_pagedefaults(WIDTH,300,FGCOLOR,'#ffffcc', BGCOLOR,'#666666'); //--> </SCRIPT>
You'll notice that this routine uses the same command line structure that an invocation of overLIB does. It will change the default variable settings only for the current page and must be used on each page where you want these changes to be effective. This command could also be used in an onMouseOver or onClick event attached to a triggering link. This is particularly useful for those parameters that behave like toggle switches because now you can effectively toggle that behavior off and on. This method and method #2 don't involve any permanent changes in the overLIB code.
An overLIB popup is usually closed by invoking the nd()
routine on mouseout. This closing routine takes an optional time (in
msecs) parameter, as in nd(300)
,
which specifies a 0.3 second delay in the closing the popup.
If there has been any delay scheduled for showing the popup,
this closing delay will be cancelled.
General Information
Additional features included in the core module that weren't included in version 3.51 include:
- The ability for overLIB to work in conjunction with other scripts that may also be capturing mousemovements.
- A delay on mouseout. The default action is for no delay. However, if you specify a time, in milli-seconds, in the call to the nd( ) routine, as in nd(millisecs), there will be a millisecs delay in closing the popup. If there has been any delay scheduled in the appearance of the popup, this action is not applied. This behavior can affect any popup whether its a STICKY or not. If a delay time is specified via this mechanism, any TIMEOUT applied to an earlier popup will be terminated.
- mouseout/mouseoff capability. For STICKY popups, if you
specify NOCLOSE on the command line so that there isn't
any Close text, the popup can be closed by first
mousing into and then out of it. (Of course, activating
any other overLIB popup on the page will also close this
popup.) If there has also been a TIMEOUT scheduled in closing
the popup, the TIMEOUT is canceled and the popup closes
when you mouseout of it. There is a parameter, described
below, which allows this same action to be specified for
a normal STICKY popup (one which also has a close link).
NOTE: The MOUSEOFF command accepts an optional parameter which specifies a delay time, in milli-seconds, before the popup is closed.
- Leading Argument
- A few statements are needed about the change in behavior
that was introduced with version 3.51 of overLIB and this
core module. In previous versions of overLIB, the leading
argument had to be either a string value or the parameter
INARRAY. In version 3.51, this requirement was removed.
The only absolute requirement now is that if you are supplying
a string argument to the overLIB call, it must be the first
argument. In particular if no string is being supplied to
overLIB then any of the other parameters can be supplied
in any order. In addition, a leading number which falls
outside the range of a valid command can also be used as
text for the popup. Numbers between 10,000,000 and 10,001,000
are reserved for commands. The INARRAY or FUNCTION parameters
don't need to be the leading argument. Note: any HTML markup
that is contained within the string argument supplied to
overLIB should convert the characters that deliminate html
tags (<...>) to their entity references (<
and > respectively). Better yet, your should define
a separate text variable in a SCRIPT block within the HEAD
section of the document and pass that to the overLIB call.
If you do this then you don't need to replace the HTML delimiting
characters by their entity references.
This same requirement pertains to the overlib_pagedefaults routine. If you supply a string argument in a call to this routine, it will become the default setting for the ol_text variable rather than the normal 'Default Text' string. - onLoad Handlers
- In IE and Opera 7.x, if a direct call to overlib(), nd(), or cClick() is assigned to the onLoad event associated with the BODY tag, then these calls will be handled within OLonLoad_handler() since they are not functional until the loaded flag (olLoaded) is set within this handler. Unfortunately, OLonLoad_handler() is not called until after all other onLoad events have been called. Consequently, if a function which calls one of these overLIB functions is assigned to the onLoad event, then the call must be preceded by the statement olLoaded=1; for these functions to work as intended. This step is not required for Gecko-based browsers which use W3C methods to set this flag before any other onLoad events are called.. In addition, in keeping with the diminishing support for Netscape 4.x, nothing special is done for that browser other than setting the loaded flag to true at the end of the Core Module. None of Plugins set or reset this flag so if there is a delay, which is highly unlikely, calls using these plugins may not work correctly until everything has loaded.
- overDiv Container
- With v4.10 or later of the core module, the overDiv declaration
statement is no longer necessary , since the overLIB code will dynamically
create this container in all supported browsers if it isn't included in the
document already. However, it is strongly recommended that the user get in
the habit of including this statement just after the BODY tag:
<div ID="overDiv" style="position: absolute; visibility: hidden; z-index: 1000;">
</div>
Behavior, Positioning and Sizes
- STICKY
- Makes the popup stick around until closed.
Variable: ol_sticky - WIDTH pixels
- Sets the width of the box to the size given by the value
pixels, a number.
Variable: ol_width - HEIGHT pixels
- Sets the height of the box to the given value pixels,
a number.
Variable: ol_height - LEFT
- Makes the popups go to the left of the mouse.
Variable: ol_hpos - RIGHT
- Makes the popups go to the right of the mouse.
Variable: ol_hpos - CENTER
- Makes the popups go to the center of the mouse.
Variable: ol_hpos - ABOVE
- Makes the popups go above the mouse. Note: The HEIGHT
of the popup is automatically accounted for internally when
positioning the popup.
Variable: ol_vpos - BELOW
- Makes the popups go below the mouse.
Variable: ol_vpos - OFFSETX x
- How far away from the pointer the popup will show up,
horizontally. A number whose default value is 10.
Variable: ol_offsetx - OFFSETY y
- How far away from the pointer the popup will show up,
vertically. A number whose default value is 10.
Variable: ol_offsety - AUTOSTATUS
- Sets the status bar's text to the popup's text. Overrides
STATUS.
Variable: ol_autostatus - AUTOSTATUSCAP
- Sets the status bar's text to the popup's caption. Overrides
AUTOSTATUS and STATUS.
Variable: ol_autostatus - SNAPX grid
- Snaps the popup to an even position in a horizontal grid.
Variable: ol_snapx - SNAPY grid
- Snaps the popup to an even position in a vertical grid.
Variable: ol_snapy - FIXX position
- Locks the popups horizontal position, a number in pixels.
Overrides all other horizontal placement commands, except RELX which takes precedence.
This position is relative to the upper left hand corner of the document.
Variable: ol_fixx - FIXY position
- Locks the popups vertical position, a number in pixels.
Overrides all other vertical placement commands, except RELY which takes precedence.
This position is relative to the upper left hand corner of the document.
Variable: ol_fixy - RELX position
- Positions the popups horizontal position, a number in
pixels, relative to the upper left hand corner of the browser
window. Overrides all other horizontal placement commands, including FIXX. Negative
values will position the popup from the browser's right
hand edge (as in this example which positions the popup
100 pixels from the right).
Variable: ol_relx - RELY position
- Positions the popups vertical position, a number in pixels,
relative to the upper left hand corner of the browser window.
Overrides all other vertical placement commands, including FIXY. Negative values
will position the popup from the bottom edge (as in this
example which positions the popup 100 pixels above the bottomw
edge of the browser window).
Variable: ol_rely - FRAME frame
- Controls popups in a different frame. Make sure you have
the <DIV> tag in the target frame as well. The frame
parameter passed to this command should not be a text string,
but a frame reference. Example: overlib('Text', FRAME, parent.below),
assuming you have a frame called below. [NOTE:
The Cross Frame Support
Module must be loaded before this command will be active.
See the previous link for more information.
Variable: ol_frame - TIMEOUT millisecs
- Makes the popup go away after the requested delay, a number.
1000 millisecs is about 1 second.
Variable: ol_timeout - DELAY millisecs
- Makes that popup behave like a tooltip. It will popup
only after a certain delay specified in millisecs, a number.
One second is 1000 millisecs.
Variable: ol_delay - HAUTO
- Automatically determine if the popup should be to the
left or right of the mouse. This command switches the current
state of this parameter to its opposite state. Default value
is off (0).
Variable: ol_hauto - VAUTO
- Automatically determine if the popup should be to the
above or below of the mouse. This command switches the current
state of this parameter to its opposite state. Default value
is on (1) for this module. Note: this is opposite from the
default state in overLIB.
Variable: ol_vauto - CLOSECLICK
- Force users to click on "Close" to close sticky popups.
This command switches the current state of this parameter
to its opposite state. Default value is off (0) which means
that you close a sticky popup by mousing over the "Close"
text.
Variable: ol_closeclick
Colors, Fonts and Images
- FGCOLOR color
- Color of the inside of the popup box, a string value.
Default is '#CCCCFF'.
Variable: ol_fgcolor - BGCOLOR color
- Color of the border of the popup box, a string value.
Default is '#333399'.
Variable: ol_bgcolor - TEXTCOLOR color
- Sets the color of the text inside the box, a string value.
Default is '#000000'.
Variable: ol_textcolor - CAPCOLOR color
- Sets the color of the box's caption, a string value. Default
is '#FFFFFF'.
Variable: ol_capcolor - CLOSECOLOR color
- Sets the color of the close text, a string value. Default
is '#9999FF'.
Variable: ol_closecolor - TEXTFONT font
- Sets the font to be used by the main text, a string value.
Default is "Verdana,Arial,Helvetica".
Variable: ol_textfont - CAPTIONFONT font
- Sets the font of the caption, a string value. Default
is "Verdana,Arial,Helvetica".
Variable: ol_capfont - CLOSEFONT font
- Defines the font for the "Close" text, a string value.
Default is "Verdana,Arial,Helvetica".
Variable: ol_closefont - TEXTSIZE size
- Size of the main text's font, a number. Default is 1.
This value is too small to be easily seen when you use CSSSTYLE
and will have to be reset.
Variable: ol_textsize - CAPTIONSIZE size
- Size of the caption's font, a number. Default is 1. This
value is too small to be easily seen when you use CSSSTYLE
and will have to be reset.
Variable: ol_captionsize - CLOSESIZE size
- Size of the "Close" text's font, a number. Default is
1. This value is too small to be easily seen when you use
CSSSTYLE and will have to be reset.
Variable: ol_closesize - FGBACKGROUND picture
- Defines a picture to use instead of color for the inside
of the popup, a string value. You will most likely want
to set FGCOLOR to '' or the color will show as well. Default
is the null string ('').
Variable: ol_fgbackground - BGBACKGROUND picture
- Defines a picture to use instead of color for the border
of the popup, a string value. You will most likely want
to set BGCOLOR to '' or the color will show as well. When
having a Close link, Netscape will re-render the table cells,
making things look bad. Default is the null string ('').
Variable: ol_bgbackground - CAPICON url
- Displays a small icon before the popup caption, a string
value giving the URL of the image. Default is the null string
(''). The formatting of this image differs from the way
it was in version 3.51 of overLIB. Here, there is a 5 pixel
horizontal spacing around the image and it is aligned to
the middle of the text in the caption.
Variable: ol_capicon - BORDER pixels
- Makes the border of the popups thicker or thinner, a number.
Default is 1.
Variable: ol_border - BACKGROUND picture
- Instead of using the table box as background, your picture
will be used, a string value giving the URL for the picture.
Default is the null string ('').
Variable: ol_background - PADX left right
- Pads the background picture with horizontal whitespace
for text placement. Both values are numbers. Default is
1. Note that this is a two parameter command.
Variable: ol_padxl and ol_padxr - PADY top bottom
- Pads the background picture with vertical whitespace for
text placement. Both values are numbers. Default is 1. Note
that this is a two parameter command.
Variable: ol_padyt and ol_padyb - FULLHTML
- Allows you to control the html over a BACKGROUND picture
completely. Default value is off (0). The html code is expected
in "text". If you employ this parameter, it is best to put
the html code into a separate string variable defined in
a script block and supply that as the first argument to
the overLIB call. If you put it directly into the overLIB
call, then you should convert the characters that deliminate
html tags (<...>) by their entity references (<
and > respectively).
Variable: ol_fullhtml
Miscellaneous
- Info Object
- This object contains the core level version number, whether this is a pre-release version, the major and minor numbers of the release, the revision number of the release, and the function meets(requiredCoreVersion), which returns true if this release meets the requiredCoreVersion number, othewise it returns false (even when there is no parameter specified). This information is contained in the global variable olInfo.
- CSSOFF
- Turns off CSS features and resorts to standard html tags.
This is the default for all popups unless you specifically
invoke one of the other styling parameters (CSSSTYLE,
CSSCLASS, or CSSW3C). The command CSSCLASS
is no longer needed since this capability has been incorporated into the core
module. It has been ketp, however, for backward compatibility.
Variable: ol_css - CELLPAD normal, 5, 10, and 20 pixels of padding; can also have variable padding
- Padding, in pixels, for the main body text in a popup.
Default value is 2. There can be from one to four additional
values following this command. If there is more than one
value, then their interpretation will follow the rules of
CSS. If four values are specified then they must be in the
order TOP, RIGHT, BOTTOM, LEFT, which is the conventional
clockwise order of CSS (see the last link above). If three
values are specified, then the first one refers to the TOP
padding, the second value is the RIGHT and LEFT padding
amounts, and the last value of the three is the BOTTOM padding.
When two values are specified, the first value is the TOP
and BOTTOM padding, while the second value is the LEFT and
RIGHT padding. With a single value, the padding is applied
equally on all sides. This feature isn't available in Netscape
4.x. If there is more than one padding value, only the first
one will be applied in Netscape 4.x.
Variable: ol_cellpad - CAPTION title
- Sets the caption of the popup, a string value. Default
is the null string ('').
Variable: ol_cap - CLOSETITLE title attribute
- Sets the text string of the TITLE attribute on the close
event if CLOSECLICK is 1. Default value is "Click to
Close". If you don't want any TITLE to show, then set
this variable to the null string.
Variable: ol_closetitle - CLOSETEXT text
- Replaces the text "Close" with something else, a string
value.
Variable: ol_close - COMPATMODE treats custom classes & nd() like v3.51
- Render custom classes in a manner similar to that implemented
in v3.51 of overlib. Default
value is off (0). When used in the command line it will switch the associated
variable to its opposite state.
Variable: ol_compatmode - DONOTHING example
- As the name implies, this command does absolutely nothing at all. It was introduced because it was requested by an experienced user of overlib in order to make programming shell wrapper functions easier. There is no associated variable associated with this command.
- FOLLOWMOUSE example
- Sets whether the popup should follow the cursor. Default
is true (1). When used on the command line, it will switch
the current state of the associated default variable to
the opposite state.
Variable: ol_followmouse - NOCLOSE
- Doesn't display the text "Close" on stickies with caption.
When used on the command line, it will set event handlers
so that you can close your popup by mousing over it and
then off of it. This will also cancel any TIMEOUT that has
been scheduled for your popup.
Variable: ol_close - MOUSEOFF example example (with 1 sec delay)
- Will apply the same event handlers that are applied when
using the NOCLOSE parameter to a sticky popup that may also
have a "Close" text. Default is off (0). When
used on the command line, it will switch the current state
of the associated default variable to its opposite state.
This feature is disabled if the overLIB popup and source
code are in different frames or windows.
The MOUSEOFF command will now accept an optional parameter, which specifies the delay in closing the popup (in milli-seconds) when a user mouse's off of the popup so that he/she can return to click on any specified links that were in the popup. It is used like this: overlib(..., MOUSEOFF, 1000, ...). Like the TIMEOUT command, any delay that is specified with this command is cancelled when mousing back onto the popup and becomes reactivated when mousing off of the popup again.
Variable: ol_mouseoff - INARRAY id
- Tells overLIB to read the text from the ol_texts array,
located in overlib.js (or on page). This parameter can be
used instead of text. id is the index of the element
within the ol_texts array that you want. Note: in javascript,
arrays start with an index value of 0. Also, this parameter
no longer needs to be the first argument in a call to overLIB.
Example: overlib(INARRAY, 1).
Variable: ol_texts - CAPARRAY id
- Tells overLIB to read the caption from the ol_caps array.
(See description under INARRAY).
Variable: ol_caps - FUNCTION functionname
- Calls the specified function and takes the return value
as the text that should be displayed in the popup. The function
is called when the overLIB command parser runs.
Variable: ol_function
This parameter can be called in one of four different ways:
- FUNCTION showMe
- FUNCTION showMe(ONE, TWO)
- FUNCTION myFunctionCall ++
- FUNCTION noparameters
++ where myFunctionCall is the string "showMe('One','Two')" - STATUS text
- Sets the text in the browsers status bar to text, a string
value. Default is the null string (").
Variable: ol_status - WRAP example
- Will cause the popup to be 'shrink-wrapped' around its
content so that it is no wider then is necessary. Default
value is off (0). When used on the command line it will
switch the current state of the associated default variable
to its opposite state.
Variable: ol_wrap