How to add animation to bootstrap Tooltip?

Is there a way to add a slide animation down when a tooltip on boot.

<img src="assets/images/icons/facebook.png" alt="facebook" data-toggle="tooltip" data-placement="top" title="Find us on facebook">

 $(function () {
   $('[data-toggle="tooltip"]').tooltip({
     animation: 'fade'
   });
})

By default, it disappears, but when I use some animation on it, the dose does not work.

I tried using animate.css , but the same problem occurred.

 $(function () {
   $('[data-toggle="tooltip"]').tooltip({
     animation: 'animated slideInDown'
   });
})
+4
source share
2 answers

Tooptip is not generated until you move the element. You need to add the appropriate class from animate.css after showing the tooltip.

$(function () {
    $('[data-toggle="tooltip"]').tooltip();
    $('[data-toggle="tooltip"]').on('shown.bs.tooltip', function () {
        $('.tooltip').addClass('animated swing');
    })
})

Demo screenshot

+11
source

JavaScript. data-, data-animation="".

- bootstarp , Apply a CSS fade transition to the tooltip , animated slideInDown. , .

animate.css , .

, jquery, :

    $('[data-toggle="tooltip"]').hover(function (){
          $(this).next().addClass("animated shake");               
    });
+2

All Articles