I noticed that my twitter bootstrap tooltips were not respecting data-position
.
So, I headed over to the Twitter Bootstrap tooltips demo, specifically looking at the "Tooltip on X" examples, and this is what I get:
It looks like there is no support for the direction?
But, the popovers, which the tooltips inherit from (or possibly it's the other way around?) work:
Browsers tried:
Chromium 24.0 on Ubuntu 12.10
Firefox 19.0 on Ubuntu 12.10
Is this a bug that should be reported, or something else going on here?
I think it's a bug. From http://twitter.github.com/bootstrap/assets/js/application.js you can see the demo is called with 'selector' option.
But the 'show' function in bootstrap-tooltip.js will not check for 'selector' option when handling 'placement'. Therefore bug occurred.
Demo for this bug: http://jsfiddle.net/indream/xFC7G/
Related github issue: https://github.com/twitter/bootstrap/issues/6832
The easiest way I have found to initialize tooltips with Bootstrap is to match their code so any of your tooltips will work.
OR you can actually add this line to the very end of your bootstrap-tooltip.js file
I basically planned on if I am going to use the tooltip code, then I might as well have it enabled by default. So, I put this in my bootstrap-tooltip.js file.
Jsfiddle Jsfiddle with tooltip working
Its not a bug , but we need to initialize them .
Important Bootstrap website states "For performance reasons, the tooltip and popover data-apis are opt in, meaning you must initialize them yourself." Bootstrap website Tooltip section
The javascript to use , you will have to initialize