Textillate.js有什么用及使用实例
Textillate.js有什么用及使用实例
一、总结
一句话总结:Textillate.js – 实现动感的 CSS3 文本动画的简单插件
二、textillate.js 文字动画
textillate.js是一款强大的文字插件,若配合animate.css、fittext、lettering一起使用,这样做出来的文字特效很完美。
在线实例
使用方法
- <div id="texts">Welcome To shouce
- $(function() {
- $('#texts').fitText(3.2, {maxFontSize: 18}).textillate({initialDelay: 1000, in: {delay: 3, shuffle: true}});
- })
参数详解
| 参数 | 描述 | 默认值 |
| 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有什么用及使用实例的更多相关文章
- textillate.js 文字动画
textillate.js是一款强大的文字插件,若配合animate.css.fittext.lettering一起使用,这样做出来的文字特效很完美. 在线实例 实例演示 使用方法 <div i ...
- JS - 超强大文本动画插件Textillate.js
http://www.yyyweb.com/demo/textillate/ Textillate.js AsimplepluginforCSS3textanimations.
- jquery使用CSS3实现文字动画效果插件Textillate.js
Textillate是一款基于jquery的使用CSS3实现文字动画的小巧插件.Textillate.js集成了一些很棒的使用CSS3动画效果的 JavaScript 库,您可非常轻轻松地把这些动画效 ...
- 关于js函数,方法,对象实例的一些说明
朋友们大家好,好久没有更新文章了,最近正好有空就想着写点什么吧,加上这段时间总是能听到一些朋友们问关于js函数,方法,对象实例到底有什么区别这个问题,所以今天就献丑来简单说明一些吧! 其实这些主要都是 ...
- 【转】JS回调函数--简单易懂有实例
JS回调函数--简单易懂有实例 初学js的时候,被回调函数搞得很晕,现在回过头来总结一下什么是回调函数. 我们先来看看回调的英文定义:A callback is a function that is ...
- js的dom对象(带实例超详细全解)
js的dom对象(带实例超详细全解) 一.总结 一句话总结: 1.DOM中的方法区分大小写么? 解答:区分 2.DOM中元素和节点的关系式什么? 解答:元素就是标签,节点中有元素节点,也是标签,节点中 ...
- jquery中的each用法以及js中的each方法实现实例
each()方法能使DOM循环结构简洁,不容易出错.each()函数封装了十分强大的遍历功能,使用也很方便,它可以遍历一维数组.多维数组.DOM, JSON 等等在javaScript开发过程中使用$ ...
- Vue.js 1.x 和 2.x 实例的生命周期
在Vue.js中,在实例化Vue之前,它们都是以HTML的文本形式存在文本编辑器中.当实例化后将经历创建.编译.销毁三个主要阶段. 以下是Vue.js 1.x 实例的生命周期图示: Vue.js 1 ...
- 原生js实现分页效果(带实例)
小小插件(静态分页) 效果图: 首先实现简单功能: <!DOCTYPE html> <html> <head> <meta http-equiv=" ...
随机推荐
- 分享一个js加密的几种方法
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- java好文章链接
❀Java内存分配全面浅析:http://blog.csdn.net/yangyuankp/article/details/7651251 ❀自定义控件进阶篇1:http://mp.weixin.qq ...
- Snapshot Standby
INTRODUCTION Snapshot standby database是ORACLE 11g的新特性.允许Physical standby短时间的使用read write模式. Snapshot ...
- python stomp activemq客户端
#coding=utf-8import timeimport sysimport stomp class MyListener(object): def on_error(self, headers, ...
- windows查看硬件信息系统信息
rem 查看cpu wmic cpu list briefrem 查看物理内存wmic memphysical list briefrem 查看逻辑内存wmic memlogical list bri ...
- 取消cp命令别名
1. 取消cp命令别名unalias cpcp -rf恢复别名alias cp='cp -i'2.关闭当前用户下的cp别名配置sed -i "s/alias cp='cp -i'/#alia ...
- home.pl 正在促销,一些域名免费(终止于2017.4.4)
home.pl 正在促销,一些域名免费(终止于2017.4.4) home.pl 成立于1997年,是波兰顶尖的互联网服务公司.专注于域名登记,托管网站,保持电子邮件帐户等. home.pl 正在促 ...
- 自定义控件学习——下拉刷新ListView
效果 开始用Android Studio写了,还有挺多不明白这IDE用法的地方....蛋疼 主要思路 1. 添加了自定义的头布局 2. 默认让头布局隐藏setPadding.设置 -自身的高度 ...
- 18.Node.js 事件循环
转自:http://www.runoob.com/nodejs/nodejs-tutorial.html Node.js 是单进程单线程应用程序,但是通过事件和回调支持并发,所以性能非常高. Node ...
- APK文件浅析-Android
2011~2015,5年时间,断断续续学习了Android. 最近打算在2011年2个月认真学习的基础上,深入学习下. 由于有之前的Android基础,加上N年的Java等变成经验,自我感觉And ...