Reputation: 6793
Following the documentation I copied:
<div class="container">
<div class="row">
<div class="bs-docs-example" style="padding-bottom: 24px;">
<a href="#" class="btn btn-large btn-danger" rel="popover" data-content="And here's some amazing content. It's very engaging. right?"
data-original-title="A Title">Click to toggle popover</a>
</div>
</div>
</div>
However it isn't working. What am I doing wrong?
Upvotes: 4
Views: 8791
Reputation: 1553
Popovers are not initialized by default. If you included an all-inclusive bootstrap.js (v 2.2, 2.3), initialize it by:
$('a[data-toggle=popover]').popover();
Upvotes: 7
Reputation: 306
<a href="#" id="LinkId">Text</a>
In document ready,
$("#LinkId").popover({ title: '', content: "Popover Content", placement: 'left|top|etc', trigger: 'hover' });
All you need include is bootstrap.js
.
Upvotes: 3
Reputation: 1803
I got it to work by doing two things:
As Popover relies on Tooltip, make sure bootstrap-tooltip.js is included before bootstrap-popover.js.
Activate the plugins with a line like $('.container a').popover();
To have the popup at the top add data-placement="top"
to the a
tag.
Upvotes: 7