I'm going mad here.
I've got the following HTML:
<a href="#" rel="tooltip" title="A nice tooltip">test</a>
And the Bootstrap style tooltip refuses to display, just a normal tooltip.
I've got bootstrap.css working just fine, and I can see the classes in there
I've got all of the relevant JS files at the end of my HTML file:
<script src="bootstrap/js/jquery.js"></script>
<script src="bootstrap/js/bootstrap-alert.js"></script>
<script src="bootstrap/js/bootstrap-modal.js"></script>
<script src="bootstrap/js/bootstrap-transition.js"></script>
<script src="bootstrap/js/bootstrap-tooltip.js"></script>
I've looked at the source of Bootstrap's example and cannot see anything that initiates the tooltip anywhere in there. So I'm guessing it should just work, or am I missing something vital here?
I've got modals and alerts and other things working just fine, so I'm not a total moron ;)
Thanks for any help!
You need to do the following. Add the
code somewhere on your page (preferably in the
<head>
section).Also add
data-toggle: "tooltip"
to anything you want to enable with it.Add
data-toggle="tooltip"
at whatever elements you want with a tooltip.Tooltip and popover are NOT only-css plugins like dropdown or progressbar. To use tooltips and popover, you MUST to activate them using jquery (read javascript).
So, lets say we want a popover to be shown on click of an html button.
Then you need to have following javascript code to activate popover:
Actually, above javascript code will activate popover on all the html elements which have class "popovers-to-be-activated".
Needless to say, put the above javascript inside DOM-ready callback to activate all popovers as soon as DOM is ready:
After experiencing the same problem, I found this solution worked without having to add additional tag attributes outside of the Bootstrap required attributes.
HTML
JQuery
Hope this helps!
Put your code inside document ready
In my case I was also missing the tooltip css classes on http://twitter.github.com/bootstrap/assets/css/bootstrap.css so son't forget that.
I just added:
below bootstrap.min.js and it works.