I'm using Bootstrap 3's popover js file and by default when you hover/click the popover trigger (I only care about the left/right placement), the popover is vertically aligned in the middle from where the element is.
See this:
However, I'd like to modify this default positioning regardless of the height of the popover.
Like this:

I tried the following, but because the popover's heights can be different I don't get exactly where I want it, which is like the second image above.
$('.trigger').popover({
trigger: 'hover',
container: 'body'
}).hover(function(){
var off = $('.popover').offset(),
delta = 50,
newY = parseInt( off.top ) + delta + 'px';
$('.popover').css({top: newY });
});
Any help?
EDIT: Is there a way to extend the Bootstrap tooltip js? I ended up having to change the source code by changing the Tooltip.prototype.getCalculatedOffset function. All I did was change the left/right placement to not subtract the actualHeight
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
// return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
// placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
// placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
// /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'left' ? { top: pos.top + pos.height / 2, left: pos.left - actualWidth } :
/* placement == 'right' */ { top: pos.top + pos.height / 2, left: pos.left + pos.width }
}
Is there a way that I could create my own placement type - like placement == 'custom-left' and placement = 'custom-right' ??