微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

TheaterJS

编程之家收集整理的这个编程导航主要介绍了TheaterJS编程之家,现在分享给大家,也给大家做个参考。

TheaterJS 介绍

Theaterjs是一款模拟打字机效果的js打字机效果插件。  

安装

bower install theaterjs

npm install theaterjs

例子

<div id="vader"></div>

<div id="luke"></div>

<script src="path/to/theater.min.js"></script>

<script>

var theater = theaterjs()

theater

.on('type:start,erase:start',function () {

// add a class to actor's dom element when he starts typing/erasing

var actor = theater.getCurrentActor()

actor.$element.classList.add('is-typing')

})

.on('type:end,erase:end',function () {

// and then remove it when he's done

var actor = theater.getCurrentActor()

actor.$element.classList.remove('is-typing')

})

theater

.addActor('vader')

.addActor('luke')

theater

.addScene('vader:Luke...',400)

.addScene('luke:What?',400)

.addScene('vader:I am',200,'.','. ')

.addScene('Your father!')

.addScene(theater.replay)

</script>

网站地址:https://codepen.io/Zhouzi/pen/JoRazP

GitHub:https://github.com/Zhouzi/TheaterJS

网站描述:一个用于模拟人输入行为的 JS 库

TheaterJS

官方网站:https://codepen.io/Zhouzi/pen/JoRazP

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。