Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the bootstrap package in meteor include the bootstrap tooltip?

I do meteor add bootstrap in the console, does this add the bootstrap tooltip javascript? If not how do I add it?

like image 678
jeff_kile Avatar asked Jan 21 '13 04:01

jeff_kile


People also ask

How do I enable Bootstrap 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.

Are Bootstrap tooltips accessible?

Bootstrap's interactive components—such as modal dialogs, dropdown menus and custom tooltips—are designed to work for touch, mouse and keyboard users.

Which plugin is used to create a tooltip in bootstrap?

The tooltip plugin generates content and markup on demand, and by default places tooltips after their trigger element.

How add tooltip in bootstrap react?

We can use the following approach in ReactJS to use the react-bootstrap Tooltip Component. Tooltip Props: arrowProps: It is used to position the tooltip arrow. id: It is just an HTML id attribute that is necessary for accessibility.


2 Answers

Yes the bootstrap plugin includes the tooltip! I use it myself. A thing to note with bootstrap's tooltip is that it cannot run on HTML alone like many of the other features due to performance issues. Each tooltip has to be manually initialized, You can use .tooltip() with jquery on the element you want to tooltip-ify

For instance in your template in your html file

<template name="myTemplate">
    <a href="#" rel="tooltip" title="first tooltip">hover over me</a><br/>
    <a href="#" rel="tooltip" title="second tooltip">hover over me</a><br/>
    <a href="#" rel="tooltip" title="third tooltip">hover over me</a><br/>
</template>

And as use the below in the javascript file to initialize the tooltip

Template.myTemplate.rendered = function() {
   $('a[rel=tooltip]').tooltip() //initialize all tooltips in this template
};

Don't put the <script> tags in your template as would be suggested on various tutorials as meteor handles this in the javascript files

like image 172
Tarang Avatar answered Oct 31 '22 23:10

Tarang


Yes. The entire core bootstrap library is included when you meteor add bootstrap. All the required js and css files will be bundled with your project when you debug or deploy. Once added, you can simply start using the api:

Template.myTemplate.rendered = function() {
   $('#element').tooltip('show')
};

Note, you may want to explore the atmosphere repository for updated bootstrap options, including the bootboxjs and bootstrap-updated projects.

like image 40
TimDog Avatar answered Oct 31 '22 22:10

TimDog