Jeegoopopup documentation

Version 1.0.0

Steps required to implement the plugin:

  1. Include script references to the jquery library, and to jeegoopopup:
       <script type="text/javascript" src="/jquery-1.10.2.min.js"></script>
       <script type="text/javascript" src="/jeegoopopup/jquery.jeegoopopup.1.0.0.min.js"></script>
  2. Select a skin from the skins folder and include a reference to the skin's stylesheet:
       <link href="/jeegoopopup/skins/blue/style.css" rel="Stylesheet" type="text/css" />
  3. Open a popup by calling
       $.jeegoopopup.open(options);
       where options is an object which can be configured with properties and callbacks.
  4. Close a popup by calling
       $.jeegoopopup.close(arguments); 
       Arguments passed to the close method are passed to the onClose callback of the topmost popup.
  5. A (new) popup can be opened or closed from within (same domain) iframes by calling window.parent.$.jeegoopopup.open(options); or window.parent.$.jeegoopopup.close(arguments); respectively.
  1. Public methods.
  2. Options properties.
  3. Options callbacks.   
  4. Public properties.

Public methods

NameArgumentsFunction
$.jeegoopopup.openoptions objectOpens a new popup.
$.jeegoopopup.closeanyCloses the topmost popup. Any arguments passed to this method are passed to the onClose callback of the popup's options object.
$.jeegoopopup.centernoneCenters the topmost popup in both horizontal and vertical direction relative to the window.
$.jeegoopopup.refreshnoneReloads the popup's iframe if options.url is set.

Options properties

NameTypeDefault valueFunction
title string undefined Is displayed in the top bar of the popup.
maxTitleLengthintundefinedMaximum number of visible title characters. Cropped title is postfixed by three dots.
urlstringundefinedIf set overrides 'html' property. Is used as iframe src for popup content.
htmlstringundefinedHtml or text to be displayed as popup content.
leftintundefinedLeft offset to the window in pixels. Overrides 'right' and 'center' property.
topintundefinedTop offset to the window in pixels. Overrides 'bottom' and 'center' property.
rightintundefinedRight offset to the window in pixels. Overrides 'center' property.
bottomintundefinedBottom offset to the window in pixels. Overrides 'center' property.
centerbooltrueIf true centers the popup horizontally if left or right aren't set and vertically if top or bottom aren't set.
widthint/string'auto'The width in pixels of the popup content. Can be set to 'auto' for displaying images.
heightint/string'auto'The height in pixels of the popup content. Can be set to 'auto' for displaying images.
scrollingstring'auto'Can be set to 'yes', 'no' or 'auto'. Determines if scrollbars should appear in the popup if content is larger than popup width and/or height.
skinClassstring'jg_popup_basic'The css-class of the skin to be used. Is formed by prefixing 'jg_popup_' to the name of the skin folder.
fixedbooltrueIf true sets the popup's position to fixed. If false sets the popup's position to absolute.
overlaybooltrueIf true displays an overlay under the popup disabling any interaction with the underlying content.
overlayColorstring'#000'The background color of the overlay.
opacityint50The opacity of the overlay, value should be between 0 and 100 where 0 is fully transparant and 100 fully opaque.
loaderVerticalOffsetint0A centered loader animation is shown while loading the iframe url. This property can be used to offset the loader vertically.
parentScrollingbooltrueIf false disables scrollbars in the parent window while the popup is open. 
draggablebooltrueIf true a popup can be dragged around the screen via the top bar.
resizablebooltrueIf true a popup can be resized via the bottom right corner.
fadeInint300The time in milliseconds it takes for the first popup to fade in.

Options callbacks

NameArgumentsCalled on
onOpennoneOpening a popup via $.jeegoopopup.open(options); Is called after fade-in on first popup or after image load when displaying images.
onCloseAny arguments passed to $.jeegoopopup.close(arguments);Closing a popup via $.jeegoopopup.close(arguments); or clicking the close button of a popup.
onDragStartpopup's optionsMousedown on popup's top bar if popup's options.draggable = true.
onDragpopup's optionsDragging popup.
onDragEndpopup's optionsEnding drag via mouseup.
onResizeStartpopup's optionsMousedown on popup's lower right corner if popup's options.resizable = true.
onResizepopup's optionsResizing popup by dragging lower right corner.
onResizeEndpopup's optionsEnding resize via mouseup..

Public properties

The value of a property can be retrieved by calling it without arguments, e.g.
var opacity = $.jeegoopopup.opacity();
The value can be set by passing an argument, e.g.
$.jeegoopopup.opacity(50);
Calls can be chained, e.g.
$.jeegoopopup.opacity(50).width(500).height(400).skinClass('jg_popup_clean');

NameTypeFunction
$.jeegoopopup.opacityint (0 - 100)Gets or sets the options.opacity property of the topmost popup. On set the overlay's opacity is updated with this value.
$.jeegoopopup.overlayboolGets or sets the options.overlay property of the topmost popup. On set the overlay is turned on or off by passing true or false.
$.jeegoopopup.overlayColorstringGets or sets the options.overlayColor property of the topmost popup. On set the overlay's background color is updated with this value.
$.jeegoopopup.draggableboolGets or sets the options.draggable property of the topmost popup. On set turns draggable on or off by passing true or false.
$.jeegoopopup.resizableboolGets or sets the options.resizable property of the topmost popup. On set turns resizable on or off by passing true or false.
$.jeegoopopup.fixedboolGets or sets the options.fixed property of the topmost popup. On set switches popup's positioning to 'fixed' or 'absolute' by passing true or false.
$.jeegoopopup.widthintGets or sets the options.width property of the topmost popup. On set adjusts width of the popup.
$.jeegoopopup.heightintGets or sets the options.height property of the topmost popup. On set adjusts height of the popup.
$.jeegoopopup.topintGets or sets the options.top property of the topmost popup. On set adjusts the popup's top offset relative to the window.
$.jeegoopopup.leftintGets or sets the options.left property of the topmost popup. On set adjusts the popup's left offset relative to the window.
$.jeegoopopup.rightintGets or sets the options.right property of the topmost popup. On set adjusts the popup's right offset relative to the window and resets the popup's left offset.
$.jeegoopopup.bottomintGets or sets the options.bottom property of the topmost popup. On set adjusts the popup's bottom offset relative to the window and resets the popup's top offset.
$.jeegoopopup.titlestringGets or sets the options.title property of the topmost popup.
$.jeegoopopup.maxTitleLengthintGets or sets the options.maxTitleLength property of the topmost popup. On set crops the title to this length.
$.jeegoopopup.skinClassstringGets or sets the options.skinClass property of the topmost popup. On set changes the skin of the popup.
$.jeegoopopup.parentScrollingboolGets or sets the options.parentScrolling property of the topmost popup. On set enables or disables scrollbars on the parent window by passing true or false.
Twitter icon YouTube icon Facebook icon LinkedIn icon RSS icon