Extend Bootstrap 3 Tooltip plugin by adding 4 extra positions: top-left, top-right, bottom-left, bottom-right.
Use the following values for the data-placement
attribute:
top-l
- for top-left placementtop-r
- for top-right placementbottom-l
- for bottom-left placementbottom-r
- for bottom-right placement
Example:
<button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="top-l" title="Tooltip on top-left">Tooltip on top-left</button>
Include bootstrap-tooltip-extra-position.css
in your project or use the .scss
file:
<link rel="stylesheet" href="bootstrap-tooltip-extra-position.css" media="all" />
SASS:
@import "bootstrap-tooltip-extra-position";
Include the script after Bootstrap's main javascript file:
<script src="bootstrap.js"></script>
<script src="bootstrap-tooltip-extra-positions.js"></script>
Initialize the tooltips:
$(function () {
$('[data-toggle="tooltip"]').tooltip();
});