type |
'overlay'
'tooltip' |
'overlay' |
Sets popup type to overlay or tooltip. |
autoopen |
boolean |
false |
Shows the popup when initialized. |
scrolllock |
boolean |
false |
Disables scrolling of background content while the popup is visible. |
background |
boolean |
true |
Enables background cover.
Disabled for tooltips. |
backgroundactive |
boolean |
false |
Disable background cover and keep background elements active.
Implies background, blur and scrolllock to false |
color |
string(CSS color) |
'#000' |
Sets background color. |
opacity |
float |
0.5 |
Sets background opacity. |
horizontal |
'center'
'left'
'right'
'leftedge'
'rightedge' |
'center' |
Sets horizontal position.
Options `leftedge` and `rightedge` can be used only for tooltips, and will align the tooltip to the left or right edge of the opening element (`openelement`).
|
vertical |
'center'
'top'
'bottom'
'topedge'
'bottomedge' |
'center' |
Sets vertical position.
Options `topedge` and `bottomedge` can be used only for tooltips, and will align the tooltip to the top or bottom edge of the opening element (`openelement`).
|
offsettop |
number |
0 |
Sets top offset to tooltip.
|
offsetleft |
number |
0 |
Sets left offset to tooltip.
|
escape |
boolean |
true |
Closes the popup when Escape key is pressed. |
blur |
boolean |
true |
Closes the popup when clicked outside of it. |
setzindex |
boolean |
true |
Sets default z-index to the popup (2001) and to the background (2000). |
autozindex |
boolean |
false |
Sets highest z-index on the page to the popup.
|
keepfocus |
boolean |
true |
Lock keyboard focus inside of popup. Recommended to be enabled. |
focuselement |
string(CSS selector) |
'#{popup_id}' |
Enables you to specify the element which will be focused upon showing the popup. By default, the popup element #my_popup will recieve the initial focus. |
focusdelay |
number |
50 |
Sets a delay in milliseconds before focusing an element. This is to prevent page scrolling during opening transition, as browsers will try to move the viewport to an element which received the focus. |
pagecontainer |
string(CSS selector) |
|
Sets a page container (to help screen reader users). Page container should be the element that surrounds all the content on the page (e.g. '.container' in the case of this very page).
It's highly recommended that you set the page container to help some screen readers read the modal dialog correctly. Doing so, when the popup is visible, aria-hidden="true" will be set to the page container and aria-hidden="false" to the popup, and vice-versa when the popup closes. You can set `pagecontainer` once per website (e.g. $.fn.popup.defaults.pagecontainer = '.container').
|
outline |
boolean |
false |
Shows a default browser outline on popup element when focused.
Setting to false is equivalent to #my_popup{outline: none;}.
|
detach |
boolean |
false |
Removes popup element from the DOM after closing transition.
|
openelement |
string(CSS selector) |
'.{popup_id}_open' |
Enables you to define custom element which will open the popup on click. By default, in our case it's set to .my_popup_open. |
closeelement |
string(CSS selector) |
'.{popup_id}_close' |
Enables you to define custom element which will close the popup on click. By default, in our case it's set to .my_popup_close. |
transition |
string(CSS transition) |
|
Sets CSS transition when showing and hiding a popup.
Use this if you don't need separate transition for background, or different transition for opening and closing the popup, or if you need to transition only selected properties – otherwise set custom transitions directly in CSS.
Simple fade effect $('#my_popup').popup({transition: 'all 0.3s'}) is equivalent to #my_popup, #my_popup_wrapper, #my_popup_background {transition: all 0.3s;}
Setting fade effect for all popups on the site: $.fn.popup.defaults.transition = 'all 0.3s'; is equivalent to .popup_content, .popup_wrapper, .popup_background {transition: all 0.3s;}
|
tooltipanchor |
object
JQuery or DOM object |
|
Sets an element to be an anchor for tooltip position.
For example, for multiple opening links using the same tooltip on mouseover:
$('.my_popup_open').on({
mouseenter: function(event) {
$('#my_popup').popup({
tooltipanchor: event.target,
autoopen: true,
type: 'tooltip'
});
},
mouseleave: function() {
$('#my_popup').popup('hide');
}
});
|
Example:
$('#my_popup').popup({
opacity: 0.3,
transition: 'all 0.3s'
});
|