afsaneh alizadeh
afsaneh alizadeh

Reputation: 21

how use tippy .js in tooltip in jquery

I want to use some classes in tippyjs to change the codes when those classes are called but I don't know how to use them

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


});

Upvotes: 2

Views: 2741

Answers (1)

razu
razu

Reputation: 2077

Welcome to SO!

As stated in the Tippy JS documentation:

  1. Make sure you've included these links in your HTML
  2. Then, initialize tippy by calling the function tippy($('#someElementId')) substitute #someElementId with your HTML element

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>

Upvotes: 1

Related Questions