如何使typed.js正常工作? [英] How do I get typed.js to work properly?
本文介绍了如何使typed.js正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使typed.js正常工作,由于某种原因我无法获取它.
I am trying to get typed.js to work and for some reason I just can't get it.
在标题中
<script src="/typed.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
这是代码
<script>
$(function(){
$(".element").typed({
strings: ["First sentence.", "Second sentence."],
typeSpeed: 0
});
});
</script>
<h1><span class="element">test</span></h1>
我直接从GitHub上删除了代码.我想念什么?
I took the code right off GitHub. What am I missing?
推荐答案
TypedJS需要加载jQuery才能正常工作.只需在<head>
部分中交换脚本的顺序:
TypedJS requires jQuery to be loaded in order to work correctly. Simply swap the order of the scripts in your <head>
section:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="/typed.js" type="text/javascript"></script>
(假设您到达typed.js
的路径是正确的)
(assuming your path to typed.js
is accurate)
这篇关于如何使typed.js正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文