<a href="#" id="changeStatusLink" type="button"
class="pull-right" data-container="body" data-toggle="popover"
data-placement="bottom" data-original-title="" data-html="true"
style="margin-right: 0"><span class="glyphicon glyphicon-pencil"></span></a>
Popover内容:
<div id="changeStatusPopover" class="hide"><form>...</form></div>
JS:
$('#changeStatusLink').popover({
html: true,
content: function () {
return $('#changeStatusPopover').html();
}
});
$('body').on('click', function (e) {
$('[data-toggle="popover"]').each(function () {
if (!$(this).is(e.target) && $(this).has(e.target).length === 0
&& $('.popover').has(e.target).length === 0) {
$(this).popover('hide');
}
});
});
感谢您的帮助
答案 0 :(得分:0)