Typed.js 是一个自动打字库。输入任何字符串,它都会以你设定的速度自动打字,删除已输入的内容,并开始新的句子,直到达到你设定的字符串数量。
安装
CDN
<script src="https://unpkg.com/typed.js@2.1.0/dist/typed.umd.js"></script>
<script>可通过标签直接在浏览器中使用:
<!-- Element to contain animated typing -->
<span id="element"></span>
<!-- Load library from the CDN -->
<script src="https://unpkg.com/typed.js@2.1.0/dist/typed.umd.js"></script>
<!-- Setup and start animation! -->
<script>
var typed = new Typed('#element', {
strings: ['<i>First</i> sentence.', '& a second sentence.'],
typeSpeed: 50,
});
</script>
</body>
作为 ES 模块
可与……一起使用

