如何在jQuery的工具提示中使用tippy .js

时间:2019-12-02 06:58:00

标签: jquery tooltip tippyjs

我想在tippyjs中使用某些类来更改这些类的代码,但我不知道如何使用它们

new Tippy('.tooltip.fade.bottom.in {}', {
    position: 'top',
    animation: 'scale',
    arrow: 'true',


});

1 个答案:

答案 0 :(得分:0)

欢迎您!

Tippy JS documentation中所述:

  1. 确保已在HTML中包含这些链接
  2. 然后,通过调用函数tippy($('#someElementId'))用HTML元素替换#someElementId来初始化tippy

tippy('button');
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://unpkg.com/popper.js@1"></script>
<script src="https://unpkg.com/tippy.js@5"></script>
<link rel="stylesheet" href="https://unpkg.com/tippy.js@5/dist/backdrop.css" />
<button data-tippy-content="Tooltip">Text</button>