bootstrap popover custom position issue

758 Views Asked by At

I am using bootstrap popover. I wanted to make a custom position which places the box to the top-left of the <a>. I have the code int here and it sort of works. I adjusted the tooltip js code to take into effect the placement of top-left and it yields:

case 'top-left':
tp = {top: pos.top - actualHeight, left: pos.left - actualWidth}
break

The problem right now is, when the anchor is first clicked, the box shows up somewhere way up and way further right. But, when I click to close, then click again it shows up where it needs to be. Any thoughts?

1

There are 1 best solutions below

0
On

try to put your code in

setTimeout(function(){
    //Your code here
},1);