Anchor Command Reference

Go to the


This command reference lists the commands that can be used to position popups in overLIB with respect to reference markers on a web page. Reference markers are positioned DIV elements with a valid ID, a named image, or an Anchor, which can also be a normal hypertext link if it has a NAME and/or ID attribute specified too. In Netscape 4.x the NAME/ID values should be the same. Read the core module documentation for more information about other ways to customize overLIB. To include support for the Anchor plugin, just include the following two lines in the HEAD section of the document:

<script type="text/javascript" src="overlib.js"></script>
<script type="text/javascript" src="overlib_anchor.js">

Remember that commands are always in uppercase (case-sensitive) and can have none or up to two parameter values.

Download this module as a zip file.

[NOTE: To maintain backward compatibility with earlier versions of this module (in the REB code set, not the 'official' version), the module will also accept the commands RMRK, RMRKX, RMRKY, NORMRK, RMRKPT. However, it is recommended that the commands shown here be used instead. Future versions of this module may no longer support the older commands.]

Anchor Commands

ANCHOR example
Image used to demonstrate reference mark propertiesA string value which is a valid ID or name of a positioned DIV, image, or Anchor. If the value specified by ANCHOR can't be found, you'll get a warning message informing you of this. However, you can change that behavior by using NOANCHORWARN on the command line which will disable this warning notice and the popup behaves as a normal popup, appearing near the triggering link. By using this parameter in conjunction with the overlib_pagedefaults() routine, you can effectively toggle this behavior on and off. Default value is the null string ('').
Variable: ol_anchor
NOANCHORWARN example   toggle action
Will turn off the warning message that is given if a valid ANCHOR can't be found on the page. Default value is true (1). When used on the overLIB command line, it will switch the current state of this parameter to its opposite state.
Variable: ol_noanchorwarn
ANCHORALIGN anchor point, [popup anchor point]
Defines how a popup should be positioned with respect to a reference mark. Command parameter values can be either strings or numbers (the above link with a value of 0.5, which aligns the mid-points of both objects on top of one another). See further discussion below about numeric values. Allowable string values are Upper Left (UL), Upper Right (UR), Lower Left (LL), and Lower Right (LR). (Will accept lower case values too.) The value of this property determines the point on the reference mark where the popup is positioned and its location relative to that reference point. In other words, if ANCHORALIGN is 'LR' then the lower right corner of the popup will be positioned on the lower right corner of the reference object. You can also specify values for ANCHORX/ANCHORY, which will move the popup from its anchor point by these specified x,y offsets. Default value is 'UL'.

If you want to specify a different corner for the popup then supply a second value to this commad. The first value specifies the reference point on the reference mark and the second value specifies the corner of the popup that will be positioned there. The default behavior of this command is is the same as specifying ANCHORALIGN, 'UL','UL'. For Anchor reference marks, the first value will always be set to 'UL' in Netscape 4.x no matter what value you supply here. For other supported browsers, this restriction is not applicable. Other values can be supplied but the popup display may not be as expected, especially if the name link is split accross two or more lines. Consistent behavior will be obtained if the first value is specified as 'UL'. [NOTE: to maintain backward compatibility with earlier versions of this module, this command will also accept a two element string array as the value like this - ANCHORALIGN, ['UL','LL'] (or RMRKPT, ['UL','LL']), with the first element specifying the location on the reference mark and the second value the point on the popup. However, the preferred method now is to specify two string values as shown in the popup example above.] Parameter values to this command can also be numeric, varying from one to four numerical values. If two numerical values are specified, the first one signifies the horizontal multiplicative factor and the second one is the vertical multiplicative factor for the anchor point displacement from the upper left hand corner of the reference mark. These factors multiply the respective width and height of either the reference mark or the popup, and with just two values specified, are applied to both the reference mark and the popup. If only a single numerical value is given, then both multiplicative factors are the same. By specifying four numerical values, the user has more precise control of the anchor point. The first two values refer to the x/y displacement from the upper left hand corner on the reference mark (which is the 0,0 point) and multiply the respective width and height of that object. The second pair of numbers refer to the x/y displacement from the upper left hand corner on the popup and multiply its respective width and height values. Positive displacements are to the right and downward. String values and numerical values can be mixed but the user must explicitly give the x/y displacements for the non-string anchor point. In otherwords, the command can be given either as ..., ANCHORALIGN, 'UR', 0.5,0.5, ... or ..., ANCHORALIGN, 0.5, 0.5, 'UR', ...
Variable: ol_anchoralign
ANCHORX x-offset
Door imageA number, in pixels, which specifies the x displacement of the popup from its reference mark. Default value is 0. Positive values move the popup toward the right.
Variable: ol_anchorx
ANCHORY y-offset
A number, in pixels, which specifies the y displacement of the popup from its reference mark. Default value is 0. Positive values move the popup downward.
Variable: ol_anchory

Back to top

Thank you for visiting - Come back again soon.