MultiDialog Class
This is main plugin definition
Constructor
MultiDialog
()
Item Index
Methods
Properties
Methods
_create
-
_elements
-
[_options]
Initial and main method Could be used when MultiDialog instance is created manually
Parameters:
-
_elements
Jquery ObjecA set of jQuery selected HTML elments (one or more)
-
[_options]
Object optional_options Object with all options, see defaults
_fireCallback
()
Object
private
Fire callback event. Needs testing!
Returns:
Object with following data:
Example:
return {
eventName: eventName, // {String} Event / callback name
eventData: eventData, // {Object} Event data if available
data: data, // {Object} Current data object
dialog: this.uiDialog, // {jQuery Object} Dialog instance
group: this.group, // {Object} Current group
index: this.index // {Integer}Current item element index of group
};
_open
()
private
Checks if the dialog needs to be created or opened
_openLinkHelper
-
data
Helper to normalize incoming link parameter
Parameters:
-
data
MixedObject: data.element = link (a tag) as jQuery Object, String: URL, jQuery Object: either a link (a tag) or any HTML element
Returns:
Normalized object with data.href or at least data.element
first
()
First item in gallery group
last
()
Last item in gallery group
next
()
Next item in gallery group
Example:
api.next();
open
-
data
Opens a dialog: very flexible with all auto magic
Parameters:
-
data
Object, Jquery Object, StringPass in one of the following types:
-
object
ObjectObject with at least one: html, href or element.
-
jquery
JQuery ObjectjQuery object containing an "a" tag or any other HTML element (its content will be opened)
-
html
StringPlain HTML string
-
Example:
api.open($(".my-selector"));
api.open({ html: "<div>Any HTML string</div>" });
api.open("<div>Any HTML string</div>");
openAjax
-
data
Opens any HTML content
Parameters:
-
data
MixedObject: data.element = any HTML element as jQuery Object, String: plain HTML string, jQuery Object: any HTML element
Example:
api.openHtml( "<div>Any HTML string</div>" );
openAjax
-
data
Opens links with AJAX
Parameters:
-
data
MixedObject: data.href = link (a tag) as jQuery Object, String: URL, jQuery Object: a link (a tag) element
Example:
api.openAjax({ href: "/path/to/my/ajax/handler.php" });
openGallery
-
group
-
[index]
Opens a dialog in gallery mode: very flexible with all auto magic
Parameters:
-
group
MixedArray: An simple array with MultiDialog data objects (see open options), jQuery object: containing a set of elements or a link (a tag) elements
-
[index]
Mixed optionaljQuery Object: a link tag element within the group parameter, Integer: a index starting with 0; default is the firs element in group parameter
Example:
api.openGallery([ { href: "path/to/my/image.jpg" }, { href: "http://www.youtube.com/watch?v=VfOcyrOImLg" }]);
openIframe
-
data
Opens an iframe
Parameters:
-
data
MixedObject: data.element = link (a tag) as jQuery Object, String: URL, jQuery Object: a link (a tag) element
openImage
-
data
Opens an image
Parameters:
-
data
MixedObject: data.element = link (a tag) as jQuery Object with href pointing to an image, String: URL to an image, jQuery Object: of a ima tag
Example:
api.openImage( "/path/to/my/image.jpeg" );
api.openImage( $("<img src='/path/to/my/image.jpeg' />") );
api.openImage( $("<a href='/path/to/my/image.jpeg' />My Image</a>") );
openImage
-
data
Opens inline HTML: works with an anchor url
Parameters:
-
data
MixedObject: data.href = link (a tag) as jQuery Object with an anchor pointing to an currently available HTML element with that anchor as id attribute
Example:
api.open({ href: "/my-site.html#my-anchor" });
openVimeo
-
data
Opens Vimeo video
Parameters:
-
data
MixedObject: data.href = link (a tag) as jQuery Object
Example:
api.openVimeo({ href: "http://www.youtube.com/watch?v=aMnw5bItt3s" });
openYoutube
-
data
Opens YouTube video
Parameters:
-
data
MixedObject: data.href = link (a tag) as jQuery Object
Example:
api.open({ href: "http://www.youtube.com/watch?v=aMnw5bItt3s" });
prev
()
Previous item in gallery group
Properties
descEnabled
Boolean
Enable description pan
Default: true
dialog
Object
jQuery UI Dialog options: see jQuery UI Dialog docs for all options, some options are not available!
dialog.animateOptions
Object
Animate options as defined for jQuery UI show and hide options (see jQuery UI documentation)
dialog.closeModalOnClick
Boolean
Close MultiDialog by click on overlay
Default: true
dialog.disabled
Boolean
Disable plugin
Default: false
dialog.getVarPrefix
Boolean
GET variable prefix (?ajax=true)
Default: ""
dialog.height
Integer
Height of the content (not overall size, "auto" not allowed)
Default: 400
dialog.resized
Function
jQuery UI Dialog resize callback event (please note: native close, open and resize callbacks are not available)
dialog.useAnimation
Boolean
Animate the resizing and positioning mechanism
Default: true
dialog.useContentSize
Boolean
private
Do not alter this property!
Default: true
dialog.width
Integer
Width of the content (not overall size, "auto" not allowed)
Default: 600
Events
on.ajaxError
Fires Callback, see _fireCallback for return value.
Example:
$.MultiDialog({ on: { ajaxError: function( data ) { } } });
on.change
Fires Callback, see _fireCallback for return value.
on.close
Fires Callback, see _fireCallback for return value.
on.create
Fires Callback, see _fireCallback for return value.
on.createDialog
Fires Callback, see _fireCallback for return value.
on.imageError
Fires Callback, see _fireCallback for return value.
on.inlineError
Fires Callback, see _fireCallback for return value.
on.move
Fires Callback, see _fireCallback for return value.