其他代码

控制animate.css动画的jquery插件

阿里云

jquery.animator.js 是一款基于 animate.css 的 jquery 动画插件。Animator 插件可以为 DOM 元素提供各种 animate.css 中设定的 CSS3 动画,并额外提供当 DOM 元素进入视口时触发 CSS3 动画的方法。

使用方法:

在页面中引入 jquery 和 jquery.animator-beta.min.js 文件,以及 animate.css 样式文件。

也想出现在这里?联系我们
创客主机
  1. <link href="path/to/css/animate.css" rel="stylesheet">
  2. <script src="path/to/js/jquery.min.js"></script>
  3. <script src="path/to/js/jquery.animator-beta.min.js"></script>

使用插件:

要为一个目标 DOM 元素设置动画效果,可以简单的使用下面的 jquery 代码。

  1. $('#target-elem').addAnimation('lightSpeedIn',500);

其中 lightSpeedIn 是 animate.css 中设定的 CSS3 动画名称。如果需要在元素进入视口时,触发指定的 CSS3 动画,可以使用下面的代码:

  1. if($('#target-elem').isOnScreen()){
  2.   $('#target-elem').addAnimation('lightSpeedIn');
  3. }

你也可以将 DOM 元素上指定的动画移除:

  1. $('#ele').removeAnimation('lightSpeedIn');

jquery.animator.js-jquery 动画插件的 github 地址为:https://github.com/zugoripls/jquery.animator

控制 animate.css 动画的 jquery 插件

已有 583 人购买
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!