Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Popovers don't work with bootstrap?

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>

JSfiddle

However it isn't working. What am I doing wrong?

like image 847
user1438003 Avatar asked Dec 03 '22 02:12

user1438003


2 Answers

I got it to work by doing two things:

  1. As Popover relies on Tooltip, make sure bootstrap-tooltip.js is included before bootstrap-popover.js.

  2. 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.

like image 194
Owlvark Avatar answered Dec 11 '22 17:12

Owlvark


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();
like image 24
pri Avatar answered Dec 11 '22 15:12

pri