答案:使用弹出框html选项
您可以使用Bootstrap弹出框的html选项将关闭按钮插入到弹出框内。此外,您可以利用该.popover('hide')方法在用户单击关闭按钮时隐藏弹出窗口。让我们尝试下面的示例,看看它是如何工作的:
例试试这个代码»
Bootstrap Popover with Close Button$(document).ready(function(){
$('[data-toggle="popover"]').popover({
placement : 'top',
html : true,
title : 'User Info ×',
content : '

Jhon Carter
Excellent Bootstrap popover! I really love it.
});
$(document).on("click", ".popover .close" , function(){
$(this).parents(".popover").popover('hide');
});
});
.wrapper{
margin: 200px 150px 0;
}
.popover-title .close{
position: relative;
bottom: 3px;
}
Click Me