admin管理员组文章数量:1430560
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 ing from. I am very new to jQuery and Java Script, and not sure what is wrong.
I am trying the implement the example here:
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 bine 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;
});
}
);
" But I get an error at : "$dataholder.quicksand($filteredData,duration: 800,easing: 'easeInOutQuad'}); "
Any idea what needs to be done?
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 ing from. I am very new to jQuery and Java Script, and not sure what is wrong.
I am trying the implement the example here: http://www.evoluted/thinktank/web-development/jquery-quicksand-tutorial-filtering
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 bine 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;
});
}
);
" But I get an error at : "$dataholder.quicksand($filteredData,duration: 800,easing: 'easeInOutQuad'}); "
Any idea what needs to be done?
Share Improve this question asked Apr 26, 2012 at 17:35 aminjamaminjam 6469 silver badges25 bronze badges 9-
1
Have you properly included the
quicksand
pluglin? – Kevin B Commented Apr 26, 2012 at 17:37 - I have the following in my PHP file, and path is correct: <link rel="stylesheet" href="styles/all.css"> <script type="text/javascript" src="ajax.googleapis./ajax/libs/jquery/1.5/…> <script type="text/javascript" src="scripts/jquery.easing.1.3.js"></script> <script type="text/javascript" src="scripts/jquery.quicksand.js"></script> <script type="text/javascript" src="scripts/elegant-press.js"></script> – aminjam Commented Apr 26, 2012 at 17:46
- link is the source of jQuery.min.js – aminjam Commented Apr 26, 2012 at 17:49
-
Confirm that
$dataholder
contains elements.alert($dataholder.length)
– Kevin B Commented Apr 26, 2012 at 17:49 - 1 If that es up false, that means that the quicksand plugin isn't included on the page properly, or you are including jQuery twice. – Kevin B Commented Apr 26, 2012 at 18:55
1 Answer
Reset to default 4Including 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.
本文标签: javascriptJquery Uncaught TypeError Object ltObjectgt has no method 39quicksand39Stack Overflow
版权声明:本文标题:javascript - Jquery: Uncaught TypeError: Object #<Object> has no method 'quicksand' - Stack Overfl 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745556349a2663208.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论