Examples of STICKY popups
with the overlibmws DHTML Popup Library maintained by Foteos Macrides at Macrides Web Services Discuss these examples, seek help, and offer suggestions for STICKY support via the overlibmws Support Group. |
This link has an example of the STICKY command, with a link inside the popup and a secondary popup associated with that link. The link includes a target attribute for a new window if the link is activated. We use an exit image as the CLOSETEXT, and use CLOSECLICK to require that it be clicked to close the pop-up. We also thicken the BASE of the border by 3 pixels, use RELX and RELY for positioning with respect to the window's margins, and use SCROLL to maintain that position when the document is scrolled. The call for this example, which includes the CAPTIONPADDING, TEXTPADDING, CGLASS, FGCLASS, CAPTIONFONTCLASS, and TEXTFONTCLASS commands, is: |
onmouseover="return overlib('Here is a link to
the<br><a ' |
However, when HTML is used for the Lead Argument and/or the parameter of a command such as CLOSETEXT (or CAPTION), it is better to use string variables or array entries, so as to avoid the need to use HTML entities for reserved characters such as angle-brackets, and to simplify the handling of embedded quotes. For example, the above Lead Argument and CLOSETEXT parameter could be defined in a script block or imported .js file as: |
var mySticky = 'Here is a link to the<br><a ' |
and the variables names could instead be used (unquoted) in the function call: |
onmouseover="return overlib(mySticky, |
OK, now try the STICKY command that way, with the FILTER command added for IE v5.5+ browsers and with the FADEIN command defaulted to 52 for random selectons from the 51 (1-51) fade types (also try the non-sticky popups for the links below). The CAPBELOW command also has been added, the CLOSECLICK command has been omitted, and positioning has been changed to MIDX,0, MIDY,0 for centering in both the horizontal and vertical axes: |
onmouseover="return overlib(mySticky, |
And try a search via a sticky, scrolling popup. We set this up so that the results will be returned in a new window. We also use the EXCLUSIVE command so that this popup must be closed before any other primary overlib popups can be invoked (or one instead could use MODAL to block all access to the underlying document until the popup is closed, in which case one need not include SCROLL). Positioning is MIDX,0, RELY,20 for horizontal centering of the popup near the top of the window. Finally, we call a function to set the focus to the input field when the popup is invoked: |
onmouseover="overlib(myGoogleTxt, CAPTION,myGoogleCap, |
Use your browser's View Source option to see the definitions of the myGoogleTxt and myGoogleCap string variables and the code for the OLsf() function. |
The style sheet for the above examples is: |
<style type="text/css> |
Now try an example of a STICKY popup with a raised blue background in the caption. It uses the following overlib call: |
onmouseover="return overlib(mySticky, |
with the following javascript definiton for the closeimgBlue string variable and CSS rules for the olraisedBlue class: |
var closeimgBlue = |
And try an example of a STICKY popup with a raised metallilc background in the caption. It uses the following overlib call: |
onmouseover="return overlib(mySticky, |
with the following javascript definiton for the closeimgMetallic string variable and CSS rules for the olraisedMetallic, olcapMetallic and olfgMetallic classes: |
var closeimgMetallic = |
Note that the text-shadow property used in the olcapMetallic class
has been implemented by Safari to create a "sunken text" effect. It has
been moved to CSS3 and eventually may be implemented by other browsers as well, but CSS3
will have font-effect:engrave; explicitly for this effect. |
It is desireable to pre-load any images used in the document's popups. Those used in this document's popups have been pre-loaded via the following javascript: |
var myExit = new Image();
|
The STICKY command and other core commands in this document require only the overlibmws.js core module. The SCROLL, FILTER, EXCLUSIVE and SHADOW commands require the overlibmws_scroll.js, overlibmws_filter.js, overlibmws_exclusive.js and overlibmws_shadow.js plugin modules, respectively. The overlib2() and nd2() function calls for secondary popups require the overlibmws_overtwo.js plugin module. |
|
This document uses overlibmws and its commands. |
|
|||
|
Copyright Foteos Macrides 2002-2010 All rights reserved. |
|
|