我一直在使用typed.js一段时间,我试图打印这个字符串。
“一个长期存在的事实是,在查看其布局时,读者会被页面的可读内容分散注意力。使用Lorem Ipsum的意义在于它具有或多或少的正常字母分布,而不是使用“此处的内容,此处的内容”,使其看起来像可读的英语。许多桌面出版包和网页编辑器现在使用Lorem Ipsum作为其默认模型文本,搜索“lorem ipsum”将发现许多网站多年来,各种各样的版本都在不断发展,有时偶尔也是故意的(注入幽默等)。“
我的代码看起来像这样
$("#level-description").typed({
strings: [levelContentArray[currentlySelectedLevel-1]], //Above string is stored in this array
typeSpeed: 30
});
它开始很好并键入两行..之后,typer就停止了。如果我调整浏览器窗口的大小,那么typer会再次输入。有一点我很清楚,typed.js继续键入句子,但它没有显示。我不知道我在这里做错了什么..感谢您的帮助。
答案 0 :(得分:0)
我无法重现您的问题。工作示例:
var str = "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident sometimes on purpose (injected humour and the like).";
$("#level-description").typed({
strings: [str],
typeSpeed: 0
});

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/typed.js/1.1.4/typed.min.js"></script>
<p id="level-description"></p>
&#13;
我可以请你提供MCVE吗?