我正试图让typed.js工作,但由于某种原因,我就是搞不懂。
在标题中
<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上取了下来。我遗漏了什么?
发布于 2016-04-04 17:25:19
TypedJS需要加载jQuery才能正常工作。只需交换<head>部分中脚本的顺序:
<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的路径是准确的)
https://stackoverflow.com/questions/36408952
复制相似问题