Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter Bootstrap Tooltip: is it possible to avoid writing javascript?

I've noticed that when using Bootstrap's Tooltip, I still have to manually include this line in a javascript file to get it to work:

$('[rel="tooltip"]').tooltip();​

However, quoting the documentation:

You can use all Bootstrap plugins purely through the markup API without writing a single line of JavaScript. This is Bootstrap's first class API and should be your first consideration when using a plugin.

But that's not what I see: http://jsfiddle.net/ccmyx/1/ (try to remove the Javascript part).

Am I missing something?

like image 527
BenMorel Avatar asked Aug 31 '12 13:08

BenMorel


People also ask

How do I change text tooltip in bootstrap?

Useful if you need to change a tooltip's text after it has been initialized: $(this). tooltip('hide') . attr('data-original-title', 'new text') .

How do I change dynamic value tooltip?

Drag the calculated field to the appropriate tooltip and you'll see an ATTR dimension pill with a tooltip logo in the Marks card. Insert the ATTR budget and adjusted inflated gross calculated fields into its corresponding tooltip as seen in Image 6. After that, you're dynamic tooltip should work!

How do I use data toggle tooltip?

How To Create a Tooltip. To create a tooltip, add the data-toggle="tooltip" attribute to an element. Note: Tooltips must be initialized with jQuery: select the specified element and call the tooltip() method.


1 Answers

No, contrary to all other JavaScript components, both Tooltip and Popover do not support the data-api. This is mentioned in the documentation:

For performance reasons, the Tooltip and Popover data-apis are opt in. If you would like to use them just specify a selector option.

like image 59
João Silva Avatar answered Sep 23 '22 10:09

João Silva