dojox/image/LightboxNano (version 1.10)

Summary

A simple "nano" version of the lightbox.

Very lightweight lightbox which only displays a larger image. There is no support for a caption or description. The lightbox can be closed by clicking any where or pressing any key. This widget is intended to be used on <a> and <img> tags. Upon creation, if the domNode is <img> tag, then it is wrapped in an <a> tag, then a <div class="enlarge"> is placed inside the <a> and can be styled to display an icon that the original can be enlarged.

Usage

var foo = new LightboxNano(p,n);
dojox/image/LightboxNano
Parameter Type Description
p Object
Optional
n DomNode
Optional

See the dojox/image/LightboxNano reference documentation for more information.

Examples

Example 1

<a dojoType="dojox.image.LightboxNano" href="/path/to/largeimage.jpg"><img src="/path/to/thumbnail.jpg"></a>

Example 2

<img dojoType="dojox.image.LightboxNano" src="/path/to/thumbnail.jpg" href="/path/to/largeimage.jpg">

Property Summary

  • durationThe delay in milliseconds of the LightboxNano open and close animation.
  • hrefURL to the large image to show in the lightbox.
  • preloadDelayThe delay in milliseconds after the LightboxNano is created before preloading the larger image.

Method Summary

  • _anim(node,args,onEnd) Creates the lightbox open/close and background fadein/out animations
  • _coords(s,e) Returns animation parameters with the start and end coords
  • _hide() Closes the lightbox
  • _hideLoading() Hides the animated loading indicator
  • _key(e) A key was pressed, so hide the lightbox
  • _load(e) Creates the large image and begins to show it
  • _reset() Destroys the lightbox
  • _show() The image is now loaded, calculate size and display according to viewport size.
  • _sizeBg() Resize the background to fill the page
  • destroy() Destroys the LightboxNano and it's DOM node
  • show(args) Shows this LightboxNano programatically.

Properties

duration

The delay in milliseconds of the LightboxNano open and close animation.

href

URL to the large image to show in the lightbox.

preloadDelay

The delay in milliseconds after the LightboxNano is created before preloading the larger image.

Methods

_anim(node,args,onEnd)

Creates the lightbox open/close and background fadein/out animations

Parameter Type Description
node DomNode
args Object
onEnd Function
Returns:[object Value(type: function, value: undefined)]
_coords(s,e)

Returns animation parameters with the start and end coords

Parameter Type Description
s Object
e Object
Returns:Object
_hide()

Closes the lightbox

_hideLoading()

Hides the animated loading indicator

_key(e)

A key was pressed, so hide the lightbox

Parameter Type Description
e Event
_load(e)

Creates the large image and begins to show it

Parameter Type Description
e Event
Optional
_reset()

Destroys the lightbox

_show()

The image is now loaded, calculate size and display according to viewport size.

_sizeBg()

Resize the background to fill the page

destroy()

Destroys the LightboxNano and it's DOM node

show(args)

Shows this LightboxNano programatically. Allows passing a new href and a programmatic origin.

Parameter Type Description
args Object
Optional

An object with optional members of href and origin. origin can be be a String|Id of a DomNode to use when animating the opening of the image (the 'box' effect starts from this origin point. eg: { origin: e.target }) If there's no origin, it will use the center of the viewport. The href member is a string URL for the image to be displayed. Omitting either of these members will revert to the default href (which could be absent in some cases) and the original srcNodeRef for the widget.

Error in the documentation? Can’t find what you are looking for? Let us know!