对象没有方法'flexslider' [英] Object has no method 'flexslider'
问题描述
我正在尝试在我的网站上设置'flexslider'。
I am trying to set up 'flexslider' on my website.
所以我使用这个jQuery加载函数,显然它没有加载..
So I am using this jQuery to load the function and apparently it doesnt load..
$(window).load(function() {
$('.flexslider').flexslider({
animation: "slides",
animationLoop: false,
itemWidth: 100,
itemMargin: 5
});
});
但是当我在控制台中查看时,我收到此错误消息:
But I get this errormessage when I am looking in the console:
Uncaught TypeError: Object [object Object] has no method 'flexslider'
如果网站可以提供任何帮助: http:// nworks .nu / projects2013 / sthlm / index.html
If the website could come to any help: http://nworks.nu/projects2013/sthlm/index.html
推荐答案
这个错误主要有两个原因。
Mainly two reasons for this error.
- 要么你没有包含所需的插件。
- 你已经包含了两次jQuery。
你正在做第二件事,即包括jQuery两次。
You are doing the second thing i.e. including jQuery twice.
jQuery 1.6.2位于顶部(在flexslider js之前)和jQuery 1.9.1位于底部(在之前< / body>
)
jQuery 1.6.2 at the top (before flexslider js) and jQuery 1.9.1 at the bottom (right before </body>
)
请更正,错误将消失。
ps使用 $(document).ready()
代替 $(window).load()
并且不要使用 frames
p.s. Use $(document).ready()
in place of $(window).load()
and do not use frames
这篇关于对象没有方法'flexslider'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!