I'm creating a popopver
where I put a close button on it. As shown below in the image:
HTML:
<divclass="dropdown" style="float: right;">
<button type="button" class="btn btn-default btn-xs popover-markup" data-placement="bottom" style="margin-right: 10px">Preferências</button>
<div class="head hide">Opção do cliente <a class="close" href="#");">×</a></div>
<div class="content hide">
<div class="form-group">
<input type="checkbox" name="vehicle" class="checkbox-avatar-store"> Lojas do cliente<br>
</div>
<div class="form-group">
<input type="checkbox" name="vehicle" class="checkbox-competition"> Lojas concorrentes<br>
</div>
</div>
</div>
JQuery:
$('.popover-markup').popover({
html: true,
title: function () {
return $(this).parent().find('.head').html();
},
content: function () {
return $(this).parent().find('.content').html();
}
}).on('shown.bs.popover', function () {
var $popup = $(this);
$(this).next('.popover').find('a.close').click(function (e) {
$popup.popover('hide');
});
});
After it is closed using the popover('hide')
method, as shown in the code above, you can only open it again by double-clicking the Preferences button. Because? Should not open with just 1 click? How can I resolve this problem?