How do you position the bootstrap popover so that it doesn't float away from the triggering element upon window resize?
what css needs to be applied to move the tip to the top edge of the popover i.e near the corner?
I have the following options set but it places the popover on the left instead of right.
$(function () {
$('.js-tooltip-trigger').popover({
html: true,
trigger: 'focus',
placement: 'auto right',
content: function (e) {
return $(this).parent(".form-group").find(".js-tooltip").html();
}
}).on('shown.bs.popover', function () {
$('.popover').css('top',parseInt($('.popover').css('top')) + 22 + 'px')
});
});
The html:
<div class="form-group">
<label for="ref">Reference</label>
<input type="text" class="form-control js-tooltip-trigger" id="ref" maxlength="50" >
<div class="js-tooltip" style="display: none;">
<p><strong>Your reference is optional.</strong></p>
<p>Enter a code of your choice for reference purposes.</p>
</div>
</div>