Tested with: Internet Explorer 6 - 10, Firefox, Chrome, and Safari.
Background. This plugin was developed to support a training application that displays
reference materials and questions in modal-like popup "windows." Because questions may appear when a reference
popup is open, the plugin allows more than one popup to be open at a time—but only one is visible.
When a popup is closed, any previously open popup is redisplayed. HTML-formatted content for the popup is obtained
from an external file using the jQuery.servercomm plugin.
Limitations. The first line of the external file containing popup content MUST contain
the string "Success|" as its initial content. This string is removed with the remaining content passed to $.popup as html. This
limitation will be removed in a future version.
How to use this demonstration. Click one of the buttons below.
A function that will be called after the popup is created, inserted into the DOM, and just before
it is rendered. The function context (this) is set to the DIV element serving as the
popup container.
$.popup.options.successArgs (array) [ null ]
An array of values that will be passed as arguments to the successCallback function using the apply() method.
A function that will be called after the popup is closed and removed from the DOM. The function context (this)
is set to the DIV element serving as the popup container for any previously displayed popup. If there was
no previous popup then the function content is set to null.
$.popup.options.closeArgs (array) [ null ]
An array of values that will be passed as arguments to the closeCallback function using the apply() method.
jQuery.popup public methods:
$.popup.configure( config )
Sets popup options where config is an object containing new values that will act as defaults
for subsequent requests.
$.popup.popupOpen()
Returns true if a popup is open otherwise false.
$.popup.show( config )
Displays a popup based on the values passed in the config parameter.
jQuery.popup known issues:
jQuery.popup uses a background image on the body to prevent jittering in Internet Explorer 6
when the page is scrolled and a popup is open (see [ http://www.webmasterworld.com/css/3592524.htm ]).
Recent css reset stylesheets that set background:transparent on the body interfere
with this "fix." To work around this problem use conditional comments or other method of detecting IE6
and add, { background:#fff url(images/clear1.gif) fixed }, with a color of you choice, as a body style
after the reset stylesheet has loaded.