popover

How can I keep bootstrap popover alive while the popover is being hovered?

纵饮孤独 提交于 2019-11-26 03:36:46
问题 I am using twitter boostrap\'s popover to create a hover card to show user info, and I am triggering popover on mouseover check jsfiddle here . I want to keep this popover alive while it being hovered. <a href=\"#\" id=\"example\" class=\"btn btn-danger\" rel=\"popover\" >hover for popover</a> $(\'#example\').popover({ html : true, trigger : \'manual\', content : function() { return \'<div class=\"box\"></div>\'; } }); $(document).on(\'mouseover\', \'#example\', function(){ $(\'#example\')

How to dismiss a Twitter Bootstrap popover by clicking outside?

不羁岁月 提交于 2019-11-26 03:25:53
问题 Can we get popovers to be dismissable in the same way as modals, ie. make them close when user clicks somewhere outside of them? Unfortunately I can\'t just use real modal instead of popover, because modal means position:fixed and that would be no popover anymore. :( 回答1: Update: A slightly more robust solution: http://jsfiddle.net/mattdlockyer/C5GBU/72/ For buttons containing text only: $('body').on('click', function (e) { //did not click a popover toggle or popover if ($(e.target).data(