Bootstrap Popover Enhancement Plugin with jQuery - WebUI Popover

File Size: 274 KB
Views Total: 32960
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Bootstrap Popover Enhancement Plugin with jQuery - WebUI Popover

WebUI Popover is a powerful yet easy jQuery plugin used to extend the Bootstrap popover component with following advanced features:

  • Auto position.
  • More specific positions.
  • Custom triggers.
  • Multiple popovers at once.
  • Popover title.
  • Closeable popover.
  • Pop with any elements (table, list, iframe, etc...)
  • Custom callback events.

How to use it:

1. Load the required jQuery WebUI Popover stylesheet in the head section.

<link rel="stylesheet" href="dist/jquery.webui-popover.min.css">

2. Load jQuery library and the jQuery WebUI Popover plugin at the bottom for faster page loading.

<script src="//"></script>	
<script src="dist/jquery.webui-popover.min.js"></script>

3. Basic usage.


4. All the default settings.

// auto,top,right,bottom,left,top-right,
// top-left,bottom-right,bottom-left

container: null,

// can be set with number

// hover,click,sticky,manual

// custom styles

// jQuery selector, if a selector is provided, popover objects will be delegated to the specified.
selector: false,  

// show and hide delay time of the popover
// works only when trigger is 'hover'
// the value can be number or object
delay: {
  show: null,
  hide: 300

async: {
  type: 'GET',
  //executed before ajax request
  before: function(that, xhr) {},
  // executed after successful ajax request
  success: success(that, data) {},
  //function(that, xhr, data){}
  error: null 

// if set to false,popover will destroy and recreate

// multiple popovers in page at same time

// show arrow or not

// the popover title

// content of the popover,content can be function

// display close button or not

// content padding

// if not empty ,plugin will load content by url

// 'html','iframe','async'

// ltr,rtl
direction: '', 

// custom animation
animation: null,

// custom template
template: '<div class="webui-popover">' +
    '<div class="arrow"></div>' +
    '<div class="webui-popover-inner">' +
    '<a href="#" class="close">x</a>' +
    '<h3 class="webui-popover-title"></h3>' +
    '<div class="webui-popover-content"><i class="icon-refresh"></i> <p>&nbsp;</p></div>' +
    '</div>' +

// if backdrop is set to true, popover will use backdrop on open
backdrop: false,

// if popover can be dismissed by  outside click or escape key
dismissible: true,

// callbacks
onShow: null,
onHide: null,

// abort XHR
abortXHR: true,

// automatic hide the popover by a specified timeout, the value must be false,or a number(1000 = 1s).
autoHide: false,

// offset the top of the popover
offsetTop: 0,

// offset the left of the popover
offsetLeft: 0,

iframeOptions: {
  frameborder: '0',
  allowtransparency: 'true',
  id: '',
  name: '',
  scrolling: '',
  onload: '',
  height: '',
  width: ''

hideEmpty: false

5. API Methods.

// Show Popover with options'#el',{title:' hello popover',width:300});

//Hide Popover by jQuery selector

//Hide All Popovers

//Update the Popover content 
WebuiPopovers.updateContent('.btn-showpop','some html or text');

Change logs:

v1.2.18 (2017-01-20)

  • fix touch event bugs,fix cache bugs

v1.2.14 (2016-10-19)

  • fixed some bugs
  • add new global method 'updateContentAsync' for async mode.
  • add new global method 'setDefaultOptions'

v1.2.14 (2016-09-07)

  • add global method 'updateContent'
  • add new option: 'selector' for delegate, now the plugin can deal with dynamic created content.
  • fix hover bugs

v1.2.13 (2016-08-24)

  • fix the arrow hidden bug in firefox
  • fix the position bug when container's position is 'relative'
  • add options to '' method
  • add 'WebuiPopovers.create','WebuiPopovers.isCreated' methods
  • fix bugs,add new API and test htmls

v1.2.12 (2016-06-29)

  • add global object,fixed cache bugs

v1.2.11 (2016-05-26)

  • fix the position in container bug
  • fix the hidden bug in show method when trigger is set to 'manual'.
  • fix the position bug with svg.

v1.2.8 (2016-05-14)

  • fix and optimize the scroll placement bug
  • add rtl direction support
  • fix arrow hide bug when placement is set to auto or auto-buttom
  • fix the LESS variable collision

v1.2.7 (2016-04-12)

  • fix the scroll placement bug

v1.2.5 (2016-01-08)

  • bugfix

v1.2.4 (2015-12-17)

  • add async request method option:async.type,default value is 'GET'.
  • optimize the close button, make it more customizable.

v1.2.3 (2015-11-18)

  • fix the bug which cause the popover hide by click when multi popovers in same page.
  • optimize event handling for performance

v1.2.1 (2015-11-06)

  • now option url can be set with jQuery selector (eg: '#myContent') when type equals 'html'.
  • fix the bug which cause the popover content lost event handler.

v1.2.0 (2015-11-05)

  • make the animation avaiable for hidding.
  • add new trigger:'sticky'.
  • remove the option:constrains, move the value 'horizontal/vertical' to placement.
  • fix the bug which caused the popover can't be closed on mobile device.
  • new way to init popover content, set the content by next element html which has class 'webui-popover'.
  • optimese the calulate position algorithm.
  • update the demo page adapt for mobile device.

v1.1.9 (2015-11-04)

  • optimized the pop animation,update the demo for trigger:sticky


  • v1.1.7


  • fix auto-placement problem


  • v1.1.6


  • fixed trigger element click handler problem


  • fixed some bugs, and reformat the source code by js beautifier


  • fix content load bug with async mode


  • add trigger option: manual and update demo for this option


  • fixed delay 0 not work problem


  • fixed the arrow position bug when element width/height larger than target width/height


  • fixed body click event bug on async mode
  • fixed loading icon position on async mode


  • update version to 1.1.0


  • fixed arrow position problem of bottom-left


  • fixed positions bugs
  • replace async loading animation to gif img
  • add escape key handler to close the pop
  • fixed arrow position problem


  • fix css problems

This awesome jQuery plugin is developed by sandywalker. For more Advanced Usages, please check the demo page or visit the official website.