Enable popovers via JavaScript:
wvusUikit('#example').popover(options)
Enable popovers via JavaScript:
wvusUikit('#example').popover(options)
Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-
, as in data-animation=""
.
Name | Type | Default | Description |
---|---|---|---|
animation | boolean | true | Apply a CSS fade transition to the popover |
html | boolean | false | Insert HTML into the popover. If false, jQuery's text method will be used to insert content into the DOM. Use text if you're worried about XSS attacks. |
placement | string | function | 'right' | How to position the popover - top | bottom | left | right | auto. When "auto" is specified, it will dynamically reorient the popover. For example, if placement is "auto left", the popover will display to the left when possible, otherwise it will display right. |
selector | string | false | If a selector is provided, popover objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See this and an informative example. |
trigger | string | 'click' | How popover is triggered - click | hover | focus | manual |
title | string | function | '' | Default title value if title attribute isn't present |
content | string | function | '' |
Default content value if If a function is given, it will be called with 1 argument, which is the element that the popover is attached to. |
delay | number | object | 0 |
Delay showing and hiding the popover (ms) - does not apply to manual trigger type If a number is supplied, delay is applied to both hide/show Object structure is: |
container | string | false | false |
Appends the popover to a specific element. Example: |
Options for individual popovers can alternatively be specified through the use of data attributes, as explained above.
Initializes popovers for an element collection.
Reveals an elements popover.
wvusUikit('#element').popover('show')
Hides an elements popover.
wvusUikit('#element').popover('hide')
Toggles an elements popover.
wvusUikit('#element').popover('toggle')
Hides and destroys an element's popover.
wvusUikit('#element').popover('destroy')
Event Type | Description |
---|---|
show.bs.popover | This event fires immediately when the show instance method is called. |
shown.bs.popover | This event is fired when the popover has been made visible to the user (will wait for CSS transitions to complete). |
hide.bs.popover | This event is fired immediately when the hide instance method has been called. |
hidden.bs.popover | This event is fired when the popover has finished being hidden from the user (will wait for CSS transitions to complete). |
wvusUikit('#myPopover').on('hidden.bs.popover', function () {
// do something…
})