我正在尝试将此typed.js实现到我的网站,并且遇到了jquery
的问题Firebug显示两个错误:
SyntaxError: expected expression, got '<'
<!DOCTYPE html> <br>
typed.js (line 1)
TypeError: $(...).typed is not a function <br>
$(".typing").typed({<br>
mydomain.com (line 74)
这是我的代码:
<!-- Javascript -->
<script src="assets/js/jquery-1.10.2.min.js"></script>
<script src="assets/js/typed.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/jquery.countdown.js"></script>
<script src="assets/js/custom.js"></script>
<script>
$(function(){
$(".typing").typed({
strings: ["Typed.js is a <strong>jQuery</strong> plugin.", "It <em>types</em> out sentences.", "And then deletes them.", "Try it out!"],
typeSpeed: 30,
backDelay: 500,
loop: false,
contentType: 'html', // or text
// defaults to false for infinite loop
loopCount: false,
callback: function(){ foo(); },
resetCallback: function() { newTyped(); }
});
$(".reset").click(function(){
$("#typed").typed('reset');
});
});
function newTyped(){ /* A new typed object */ }
function foo(){ console.log("Callback"); }
</script>
最终设置在body标签
之前据我所知,2个jquery库之间存在冲突,但我对此很安静,所以无法理解如何修复它。
请帮帮我)