Textillate.js有什么用及使用实例

一、总结

一句话总结:Textillate.js – 实现动感的 CSS3 文本动画的简单插件

二、textillate.js 文字动画

textillate.js是一款强大的文字插件,若配合animate.css、fittext、lettering一起使用,这样做出来的文字特效很完美。

在线实例

实例演示

使用方法

  1. <div id="texts">Welcome To shouce
复制
  1. $(function() {
  2. $('#texts').fitText(3.2, {maxFontSize: 18}).textillate({initialDelay: 1000, in: {delay: 3, shuffle: true}});
  3. })
复制

参数详解

参数 描述 默认值
selector 目标选择器 .texts
loop 是否循环 false
minDisplayTime 最小间隔时间 2000
initialDelay 初始化间隔时间 0
in {       effect: 'fadeInLeftBig',       delayScale: 1.5,       delay: 50,       sync: false,       reverse: false,       shuffle: false,       callback: function () {}     } -
out {       effect: 'hinge',       delayScale: 1.5,       delay: 50,       sync: false,       reverse: false,       shuffle: false,       callback: function () {}     } -
autoStart 自动开始 true
callback 回调函数 function () {} -

三、Textillate.js 使用

Textillate.js 是一款实现极酷 CSS3 文本动画的简单插件。它整合了两个流行的工具库(animate.css 和 lettering.js)来提供易于使用的插件,能够把 CSS3 动画应用到文本内容上。

第一步:

当然是下载插件,下载地址(https://github.com/jschr/textillate);

第二步:

当然是引用文件,此插件是基于 jquery的所以你的项目中必须包含 jquery插件(这个简单自己下吧),然后就是把 它的必要文件引入!

<link rel="stylesheet" href="css/animate.css" /> //css文件
 <script src="textJs/jquery.fittext.js"></script>
 <script src="textJs/jquery.lettering.js"></script>
 <script src="textJs/jquery.textillate.js"></script>//(注意这几个文件最好放在最后面引入)

第三步:

用法 html中

<h1 class="tlt" data-in-effect="rollIn">Title</h1>

js中

$('.tlt').textillate();

第四步:配置

$('.tlt').textillate({
  // the default selector to use when detecting multiple texts to animate
  selector: '.texts',   // enable looping
  loop: false,   // sets the minimum display time for each text before it is replaced
  minDisplayTime: 2000,   // sets the initial delay before starting the animation
  // (note that depending on the in effect you may need to manually apply 
  // visibility: hidden to the element before running this plugin)
  initialDelay: 0,   // set whether or not to automatically start animating
  autoStart: true,   // custom set of 'in' effects. This effects whether or not the 
  // character is shown/hidden before or after an animation  
  inEffects: [],   // custom set of 'out' effects
  outEffects: [ 'hinge' ],   // in animation settings
  in: {
    // set the effect name
    effect: 'fadeInLeftBig',     // set the delay factor applied to each consecutive character
    delayScale: 1.5,     // set the delay between each character
    delay: 50,     // set to true to animate all the characters at the same time
    sync: false,     // randomize the character sequence 
    // (note that shuffle doesn't make sense with sync = true)
    shuffle: false,     // reverse the character sequence 
    // (note that reverse doesn't make sense with sync = true)
    reverse: false,     // callback that executes once the animation has finished
    callback: function () {}
  },   // out animation settings.
  out: {
    effect: 'hinge',
    delayScale: 1.5,
    delay: 50,
    sync: false,
    shuffle: false,
    reverse: false,
    callback: function () {}
  },   // callback that executes once textillate has finished 
  callback: function () {}});

四、自己完整案例

记得把js和css都引进来

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link href="assets/animate.css" rel="stylesheet">
<link href="assets/style.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="assets/jquery.fittext.js"></script>
<script src="assets/jquery.lettering.js"></script>
<script src="jquery.textillate.js"></script>
</head>
<body>
<div id="texts" style="margin:30px auto;">
<span>中文可以么Welcome To shouceWelcome To shouceWelcome </span>
</div>
</body> <script>
$(function() {
// 动画效果
$('#texts').textillate({
loop: true,
autoStart: true,
in: {
shuffle: false,
effect: 'bounce'},
out: {
effect: 'hinge',
delayScale: 1.5,
delay: 30,
sync: false,
shuffle: true,
reverse: false,
callback: function () {}
}
}); })
</script>
</html>

Textillate.js有什么用及使用实例的更多相关文章

  1. textillate.js 文字动画

    textillate.js是一款强大的文字插件,若配合animate.css.fittext.lettering一起使用,这样做出来的文字特效很完美. 在线实例 实例演示 使用方法 <div i ...

  2. JS - 超强大文本动画插件Textillate.js

    http://www.yyyweb.com/demo/textillate/ Textillate.js AsimplepluginforCSS3textanimations.

  3. jquery使用CSS3实现文字动画效果插件Textillate.js

    Textillate是一款基于jquery的使用CSS3实现文字动画的小巧插件.Textillate.js集成了一些很棒的使用CSS3动画效果的 JavaScript 库,您可非常轻轻松地把这些动画效 ...

  4. 关于js函数,方法,对象实例的一些说明

    朋友们大家好,好久没有更新文章了,最近正好有空就想着写点什么吧,加上这段时间总是能听到一些朋友们问关于js函数,方法,对象实例到底有什么区别这个问题,所以今天就献丑来简单说明一些吧! 其实这些主要都是 ...

  5. 【转】JS回调函数--简单易懂有实例

    JS回调函数--简单易懂有实例 初学js的时候,被回调函数搞得很晕,现在回过头来总结一下什么是回调函数. 我们先来看看回调的英文定义:A callback is a function that is ...

  6. js的dom对象(带实例超详细全解)

    js的dom对象(带实例超详细全解) 一.总结 一句话总结: 1.DOM中的方法区分大小写么? 解答:区分 2.DOM中元素和节点的关系式什么? 解答:元素就是标签,节点中有元素节点,也是标签,节点中 ...

  7. jquery中的each用法以及js中的each方法实现实例

    each()方法能使DOM循环结构简洁,不容易出错.each()函数封装了十分强大的遍历功能,使用也很方便,它可以遍历一维数组.多维数组.DOM, JSON 等等在javaScript开发过程中使用$ ...

  8. Vue.js 1.x 和 2.x 实例的生命周期

    在Vue.js中,在实例化Vue之前,它们都是以HTML的文本形式存在文本编辑器中.当实例化后将经历创建.编译.销毁三个主要阶段. 以下是Vue.js 1.x  实例的生命周期图示: Vue.js 1 ...

  9. 原生js实现分页效果(带实例)

    小小插件(静态分页) 效果图: 首先实现简单功能: <!DOCTYPE html> <html> <head> <meta http-equiv=" ...

随机推荐

  1. 41.内存函数实现(memcpy,memset,memmove,memicmp,memchr.memccpy)

    memcpy #include <stdio.h> #include <stdlib.h> #include <memory.h> void * mymemcpy( ...

  2. VB&XML的增删改查

    简介:XML的增删改查 开发过程中有许多后台操作XML的过程,每次需要操作时都是找很多代码来参考或者百度一下.今天决定补充下XML操作的知识,把XML操作的增删改查都写了一遍,供以后开发参考 查询: ...

  3. python +uiautomator 安卓UI控件操作

    一.搭建环境 准备:win7.JDK.androidSDK(adt-bundle-windows-x86_64-20140702\sdk).Appium.安卓模拟器(真机也可以),可以到这个地址下载h ...

  4. 图片上传5-多个图片上传,独立项目Demo和源码

    图片上传,一次性可以上传多个图片,每个图片可以有名字.URL.排序.备注等字段.这是区别于使用百度WebUploader等多图上传工具的地方. 项目相关图片 Jar包管理:Maven用到的框架:Spr ...

  5. Aruba 云服务代金券

    Aruba 云服务代金券 Aruba Cloud是欧洲的一家VPS供应商,他家的VPS是基于VMware的,有英国.法国.德国.意大利.捷克5处数据中心,每个月最低1欧元,非欧洲企业客户可以免税 这里 ...

  6. system.setting-全局变量数据监听

    今天在setting里添加了一个新的变量,想要实现对这个变量的监听.现在记录下方法 首先就是明白一点,我们在system.setting里添加的变量,都会被保存在data/data/com.andro ...

  7. php中ajax使用实例

    php中ajax使用实例 一.总结 1.多复习:这两段代码都挺简单的,就是需要复习,要多看 2.ajax原理:ajax就是部分更新页面,其实还在的html页面监听到事件后,然后传给服务器进行操作,这里 ...

  8. CF1009F Dominant Indices(树上DSU/长链剖分)

    题目大意: 就是给你一棵以1为根的树,询问每一个节点的子树内节点数最多的深度(相对于这个子树根而言)若有多解,输出最小的. 解题思路: 这道题用树链剖分,两种思路: 1.树上DSU 首先想一下最暴力的 ...

  9. C#解决关闭多线程的form主窗体时抛出ObjectDisposedException 异常

    一.现象: 我在主窗体新建线程,使用子线程来处理接收到的数据,并且更新窗体显示内容,但关闭主窗体程序之后就程序就报错,如下所示: 二.分析问题: 由于新建线程的处理函数里边是一直死循环处理数据,虽然窗 ...

  10. Skill of vim

    用vim也有一段时间了,谨以此记下一些有意思的技巧. 跳转 hjkl,左下右上. b/e跳转到上/下一个单词 ^/$跳转到行头/尾 从{,[,(,相应的},],)相互跳转.能够用% 跳转到局部变量的定 ...