如何在引导工具提示上添加动画? [英] how to add animation on bootstrap Tooltip?
本文介绍了如何在引导工具提示上添加动画?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当悬停时,有任何方法可以在引导工具提示上添加向下滑动动画。
Is there any way to add slide down animation on bootstrap tooltip, when hover.
< img src =assets / images / icons / Facebook.pngalt =facebookdata-toggle =tooltipdata-placement =toptitle =在Facebook上找到我们>
$(function () {
$('[data-toggle="tooltip"]').tooltip({
animation: 'fade'
});
})
,但是当我使用一些动画时它不工作。
By default it is fade, but when I use some animation on it it dose not work.
我试图使用 animate.css 但同样的问题。
I have tried to use animate.css but same issue occurred.
$(function () {
$('[data-toggle="tooltip"]').tooltip({
animation: 'animated slideInDown'
});
})
推荐答案
在您悬停元素之前,不会生成tooptip。您需要在显示工具提示后从animate.css中添加相应的类。
The tooptip is not generated until you hover the element. You need to add the respective class from animate.css after tooltip is shown.
$(function () {
$('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="tooltip"]').on('shown.bs.tooltip', function () {
$('.tooltip').addClass('animated swing');
})
})
这篇关于如何在引导工具提示上添加动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文