I would like to implement my own popover hide animation. Currently, I am modifying bootstrap.js directly.
$.fn.popover = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('popover')
, options = typeof option == 'object' && option
if (!data) $this.data('popover', (data = new Popover(this, options)))
//original code
// if (typeof option == 'string') data[option]()
//custom code
if (typeof option == 'string') {
if (option === 'hide') {
//my customize animation here
}
else {
data[option]();
}
}
})
}
I would like to know if there are anyway so I can achieve a dynamic animation when I init the popover
$('#target').popover({
hide: function () {
//my own animation
}
});