Opens new popup or transitions to new content.
open(options);
options |
object, options for the popup |
OR
$('#id-content').w2popup('open', options);
options |
object, options for the popup |
Description
The first argument
open is the default and can be omitted.
The second argument
options is a map of properties for the popup (see
overview page
for valid options). Please note that options will not be replaces, but extended. If a popup is already displayed you can change the
width/height (or any other property) in the following way:
This method will trigger
onOpen or
onChange event depending if the popup
was just opened or it was transitioned to the new content.
Examples
You can open popup defining everything in JavaScript
Or from markup
If you open it from markup, the width and height of the popup will be taken from the root markup element. It will
also look for 3 sections for title
[rel=title], body
[rel=body]
and buttons
[rel=buttons].
IMPORTANT: If you open a popup from the markup that is already on the page, it will create two sets of same markup: one on
the page and another one in the popup. It is better to load markup from a file.
Same rules apply if you load popup from the server. When you are loading from the server, you can optionally add
#id at the end of your url. This allows to select a particular popup element, if server returns multiple in
the same file.
See
load method.