Jquery:未捕获的TypeError:Object#< Object>没有方法'流沙' [英] Jquery: Uncaught TypeError: Object #<Object> has no method 'quicksand'
问题描述
我遇到了未捕获的TypeError:对象#没有方法'流沙'的例外,我似乎无法找到错误的来源。我是jQuery和Java Script的新手,不知道出了什么问题。
I have running to the exception of "Uncaught TypeError: Object # has no method 'quicksand'", and I can't seem to find where the error is coming from. I am very new to jQuery and Java Script, and not sure what is wrong.
我在这里尝试实现这个例子: http://www.evoluted.net/thinktank/web-development/jquery-quicksand-tutorial-filtering
I am trying the implement the example here: http://www.evoluted.net/thinktank/web-development/jquery-quicksand-tutorial-filtering
我接受了那段代码,然后我运行了索引文件,我可以看到它工作正常,所以我只是将列表复制过来并获取他的main.js内容并与我已经拥有的那个相结合来获得这个功能: / p>
I took that code, and I ran the the index file, and I can see it working fine, so I just copied the list over and took his main.js content and combine with the one I already have to get this function:
$(document).ready(function () {
$("#myController").jFlow({ controller: ".jFlowControl", slideWrapper: "#jFlowSlider", slides: "#mySlides", selectedWrapper: "jFlowSelected", width: "960px", height: "350px", duration: 400, prev: ".jFlowPrev", next: ".jFlowNext", auto: true });
$().UItoTop({ easingType: 'easeOutQuart' }); jQuery("a[data-gal^='prettyPhoto']").prettyPhoto({ social_tools: false });
// get the action filter option item on page load
var $filterType = $('#filterOptions li.active a').attr('class');
// get and assign the ourHolder element to the
// $holder varible for use later
var $dataholder = $('ul.ourHolder');
// clone all items within the pre-assigned $holder element
var $data = $dataholder.clone();
// attempt to call Quicksand when a filter option
// item is clicked
$('#filterOptions li a').click(function(e) {
// reset the active class on all the buttons
$('#filterOptions li').removeClass('active');
// assign the class of the clicked filter option
// element to our $filterType variable
var $filterType = $(this).attr('class');
$(this).parent().addClass('active');
if ($filterType == 'all') {
// assign all li items to the $filteredData var when
// the 'All' filter option is clicked
var $filteredData = $data.find('li');
}
else {
// find all li elements that have our required $filterType
// values for the data-type element
var $filteredData = $data.find('li[data-type=' + $filterType + ']');
}
// call quicksand and assign transition parameters
$dataholder.quicksand($filteredData, {
duration: 800,
easing: 'easeInOutQuad',
attribute: "data-id",
});
return false;
});
}
);
但我收到错误:$ dataholder.quicksand($ filteredData,持续时间:800,缓和:'easeInOutQuad'});
" But I get an error at : "$dataholder.quicksand($filteredData,duration: 800,easing: 'easeInOutQuad'}); "
知道需要做什么吗?
推荐答案
包括jQuery的第二个副本导致上一个副本,并且所有插件都被覆盖。删除其中一个可以解决问题。
Including a 2nd copy of jQuery results in the previous copy and all of it's plugins being overridden. Removing one of them fixes the problem.
这篇关于Jquery:未捕获的TypeError:Object#< Object>没有方法'流沙'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!