Popups can specify content in three ways:
- Using html title attribute
- Using data-content attribute
- Using the content property in the initialization of the popup
--- layout : 'default' css : 'popup' title : 'Popup' description : 'A popup displays additional information on top of a page element' type : 'UI Module' --- <%- @partial('header') %>
A standard popup
A popup can be large or small
A popup can have its colors inverted
Frequently used metadata like, title, content, html, or arrowOffset or variation, can be included in html metadata
A popup can either be inserted directly after an element, or added as a child element to the page's body
.
A popup can be positioned to any side of an element. If space is not available, it will automatically search for a similar alternative position to use.
A popup can be formatted with a title
A popup can be formatted with html
A popup can have different transitions. Any transition with both an in and out animation can be specified. The following are just a few examples.
Content | ||
---|---|---|
content | Content to display | |
title | Title to display alongside content | |
html | HTML content to display instead of preformatted title and content |
Popup Settings | ||
---|---|---|
inline | true | If a popup is inline it will be created next to current element, allowing for local css rules to apply. It will not be removed from the DOM after being hidden. Otherwise popups will appended to body and removed after being hidden. |
delay | 0 | Delay in milliseconds before showing a popup when using hover events. |
variation | Popup variation to use, can use multiple variations with a space delimiter | |
on | hover | Event used to invoke popup |
clickToClose | true | Whether clicking anywhere outside a popup should close it. |
position | top center | Position that the popup should appear |
distanceAway | 0 | Distance away from element for the popup to appear. |
arrowOffset | 0 | Offset to apply to arrow positioning of element |
maxSearchDepth | 10 | Number of iterations before giving up search for popup position when a popup cannot fit on screen |
Animation | ||
---|---|---|
transition | scale | transition to use if transition module is included |
duration | 250 | Duration of popup animation. |
easing | easeOutQuint | Easing equation for popup animation |
Callbacks | ||
---|---|---|
onCreate | None | Callback after a popup html is generated. |
onShow | None | Callback after a popup section is shown. |
onHide | None | Callback after a popup section is hidden. |
UI Module Settings | ||
---|---|---|
Name | Popup | Name used in debug logs |
debug | True | Provides standard debug output to console |
performance | False | Provides performance output to console |
verbose | False | Provides ancillary debug output to console |
namespace | popup | Event namespace. Makes sure module teardown does not effect other events attached to an element. |
errors |
errors : {
method : 'The method you called is not defined.'
}
|