jQuery“$(...)。效果不是函数” [英] jQuery "$(...).effect is not a function"
本文介绍了jQuery“$(...)。效果不是函数”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经通过论坛搜索过了,但是我找不到解决jQuery中效果函数问题的方法。
I searched through the forum already but I can't find any way to fix the problem I have with the "effect" function in jQuery.
在代码中错误 TypeError:$(...)。效果不是函数
:
I get exactly the error TypeError: $(...).effect is not a function
in the code :
$('div.step').removeClass('active');
$("div.step").effect('slide', {direction: 'right', mode: 'hide'}, 500);
$('#step' + step + '').addClass('active');
$('#step' + step + '').effect('slide', {direction: 'right', mode: 'show'}, 500);
我在< head><>中包含了jQuery和jQuery UI ; / head>
:
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
但徒然,你有什么想法吗?谢谢
But in vain, do you have any idea? Thank you
推荐答案
您需要将自定义脚本放在jQuery和jQuery UI声明之后,并将其包装在 ready()
函数:
You need to put your custom script after your jQuery and jQuery UI declarations, and wrap it within a document ready()
function:
<body>
...
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script type="text/javascript">
$(document).ready(function() {
...
});
</script>
</body>
这篇关于jQuery“$(...)。效果不是函数”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文