autotyperjs 是一款打字机动画特效 js 插件 js。使用 autotyperjs 可以轻松的实现控制台打字效果,配合 CSS3 动画,可以制作漂亮的自动打字动画特效。
在页面中引入下面的文件。
<div>
<h1 class="typer-target">
AutoTyper<span>.js</span>
</h1>
</div>
var options = {
selector: ".content > h1",
words: ["hello", "world"]
};
// start auto typer
var typer = new autoTyper(options);
typer.start();
// stop autoTyper
typer.stop();
<div class="typerTarget"></div>
@-webkit-keyframes blink-caret {
50% {
border-color: transparent;
}
}
.typerTarget {
border-right: 1px solid #404145;
-webkit-animation: blink-caret 0.5s step-end infinite alternate;
animation: blink-caret 0.5s step-end infinite alternate;
}
// available custom options
var options = {
selector: ".typerTarget", // target element selector
words: [], // words/sentences that will be auto typed
charSpeed: 85, // letter typing animation speed
delay: 2100, // word/sentence typing animation delay
loop: true, // if loop is activated, autoTyper will start over
flipflop: true // if flipflop is activated, letters which are typed animated will be removed ony by one animated
};
Github 网址:https://github.com/hsynlms/autotyperjs
演示地址 | 下载地址 |
专业提供WordPress主题安装、深度汉化、加速优化等各类网站建设服务,详询在线客服!