Can I rewrite the location of the tweeter bootstrap on the fly?

I'm currently trying to reposition my popover depending on the position of the element that caused the popover.

The problem is that I initialize all my popovers with static positioning (see my example below). I want to change or set the position on the fly, directly, when I visit the element that caused the popover. Is it possible?

$(".timelineTour") .popover({ offset: 10, trigger: 'manual', animate: false, html: true, placement: 'bottom', template: '<div class="popover">' + '<div class="arrow"></div>' + '<div class="popover-inner">' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"><p></p></div>' + '</div>' + '</div>' }).mouseenter(function(){ /* examine position*/ /* ........ */ $(this).popover({ offset: 10, trigger: 'manual', animate: false, html: true, placement: 'right', template: '<div class="popover">' + '<div class="arrow"></div>' + '<div class="popover-inner">' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"><p></p></div>' + '</div>' + '</div>' }); $(this).popover('show'); }) 
+4
source share
1 answer

As of Bootstrap 2.1 at least (although I believe the function has been there for some time), options for popovers can be passed through data- attributes . That way you can simply enable data-placement="top" for the popover you want to show at the top, etc.

+1
source

All Articles