动态提示工具插件库——tippyjs
介绍
Tippyjs轻量的纯 JavaScript 动态提示工具插件库。它提供了大量的不同悬停效果和超过 20 个可定制的选项。Tippy.js 是超级轻量的, 具有相当不错的浏览器兼容性:
包括工具提示、弹出框、下拉菜单和菜单库
Github地址:
https://github.com/atomiks/tippyjs
文档:
https://atomiks.github.io/tippyjs/
包管理器
# npm
npm i tippy.js
# Yarn
yarn add tippy.js
导入tippy构造函数和核心 CSS:
import tippy from 'tippy.js';
import 'tippy.js/dist/tippy.css';
CDN
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<button id="myButton">My Button</button>
tippy('#myButton', { content: "I'm a Tippy tooltip!"});