bootstrap popover

Viewed 69693

I'm not sure how boostrap implements popover. I have included bootstrap.js, and it has a function called Popover (upper case P), but in their example, they use:

$('#example').popover(options)

Now, they say it requires tooltip to be included, but I don't know what that means. Their examples all include a bunch of .js files and I think in reality they're all packaged up together.

And since I'm at the proof-of-concept phase, where I'm trying to get it to work right the first time, I'm not concerned about the file size or caching.

3 Answers

Why popover and tooltip don't work in bootsrap?

The answer is popover or tooltip initializing code $("#myButton").popover(); should be place under <script src="js/jquery-1.10.1.min.js"></script>; and <script src="js/bootstrap.min.js"></script>.

Like the following procedure. I think will be ok.

<button type="button" id="myPopover" class="btn btn-default" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." data-original-title="" title="">
      Popover on Right
</button>

<script src="js/jquery-1.10.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/main.js"></script>

<script type="text/javascript">
      $('#myButton').tooltip();
      $('#myPopover').popover();
</script> 
Related