2016-09-06 28 views
0

我一直在使用typed.js一段时间,我试图打印这个字符串。typed.js键入文本停在中间,不可见直到调整浏览器的大小

“这是一个长期以来确定的事实,读者在查看其布局时会被页面的可读内容分散注意力。使用Lorem Ipsum的关键在于它具有或多或少正常的字母分布,而不是使用'Content here,content here',使它看起来像可读的英语。许多桌面出版软件包和网页编辑器现在使用Lorem Ipsum作为他们的默认模型文本,并且搜索'lorem ipsum'将会发现许多网页网站仍然处于初级阶段,多年来已经有不同的版本发展,有时偶尔会故意发生意外(注入幽默之类)。“

我的代码看起来像这样

$("#level-description").typed({ 
         strings: [levelContentArray[currentlySelectedLevel-1]], //Above string is stored in this array 
         typeSpeed: 30 
        }); 

它开始罚款和类型两行..之后,该类型确定刚刚停止。如果我调整浏览器窗口的大小,typer再次输入。有一点我很清楚,typed.js不断输入句子,但不显示。我不知道我在这里做错了什么..谢谢你的帮助。

回答

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>

请问您提供MCVE

相关问题