Enable popovers via JavaScript:

wvusUikit('#example').popover(options)

Enable popovers via JavaScript:

wvusUikit('#example').popover(options)

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 data-content attribute isn't present.

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: delay: { show: 500, hide: 100 }

container string | false false

Appends the popover to a specific element. Example: container: 'body'. This option is particularly useful in that it allows you to position the popover in the flow of the document near the triggering element - which will prevent the popover from floating away from the triggering element during a window resize.

Data attributes for individual popovers

Options for individual popovers can alternatively be specified through the use of data attributes, as explained above.

Methods

wvusUikit().popover(options)

Initializes popovers for an element collection.

.popover('show')

Reveals an elements popover.

wvusUikit('#element').popover('show')

.popover('hide')

Hides an elements popover.

wvusUikit('#element').popover('hide')

.popover('toggle')

Toggles an elements popover.

wvusUikit('#element').popover('toggle')

.popover('destroy')

Hides and destroys an element's popover.

wvusUikit('#element').popover('destroy')

Events

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…
})