实施例: http://jsfiddle.net/eduardojribeiro/fScua/297/
<a class='btn btn-danger button' rel="popover">Click Here</a>
$('body').popover({
selector: '[rel=popover]',
trigger: "hover",
container: "body",
title: "Lorem ipsum dolor",
content: "Phasellus lobortis, tortor iaculis viverra bibendum, est nunc lobortis justo"
});
$('.button').click(function(){ $(this).remove() });
答案 0 :(得分:0)
您必须使用selector
属性来销毁/隐藏popover:http://jsfiddle.net/fScua/363/
$('.button').click(function(){
$('[rel=popover]').popover('destroy');
$(this).remove() ;
});
答案 1 :(得分:0)
您可以将onclick
与按钮放在一起点击,它会隐藏popover
。像:
<a class='btn btn-danger button' rel="popover"
onclick="$('.popover').hide()">Click Here</a>