jQuery带动画效果的Tooltips插件

tooltipify.js是一款带动画效果的jQuery Tooltips插件。该插件可以定制tooltips的方向,出现动画,透明度等属性,使用方便,效果炫酷。

在这里插入图片描述
在线演示 下载

安装

// npm
npm install jquery-tooltipify

// Import the module:
import "jquery-tooltipify";

// scss
import "jquery-tooltipify/src/tooltipify.scss";

// css
import "jquery-tooltipify/lib/tooltipify.css";

使用方法

初始化插件

$(".tooltips").tooltipify();

配置参数

tooltipify.js可用的配置参数有:

  • animationDuration:动画的持续时间,单位毫秒,默认值100。

  • animationOffset:设置动画的偏移,默认为50。

  • animationProperty:动画的选项,设置为空时,tooltips出现不带动画。默认值为left。

  • content:tooltip的内容,可以是html标签。

  • cssClass:tooltips容器的class类。

  • displayAware:设置是否在出现方向上空间不足时,tooltips自动出现在反方向上。

  • hideEvent:设置隐藏tooltip的事件,默认为mouseout。

  • offsetLeft:设置左偏移量,默认为0。

  • offsetTop:设置上偏移量,默认为0。

  • opacity:设置透明度,默认为0.8。

  • position:设置tooltip的位置,默认为top,可选择有:“top”, “left”, “right”, “bottom”。

  • showEvent:设置显示tooltip的事件,默认为mouseover。

  • width:设置tooltip的宽度。

事件

  • hide:隐藏tooltips。
$(".tooltips").tooltipify('hide');
  • show:显示tooltips。
$(".tooltips").tooltipify('show');
  • destroy:销毁tooltips。
$(".tooltips").tooltipify('destroy');
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值