javascript - Jquery: Uncaught TypeError: Object #<Object> 没有方法 'quicksand'

标签 javascript jquery

我遇到了“Uncaught TypeError: Object # has no method 'quicksand'”的异常,我似乎无法找到错误的来源。我是 jQuery 和 Java Script 的新手,不确定哪里出了问题。

我正在尝试在此处实现示例:http://www.evoluted.net/thinktank/web-development/jquery-quicksand-tutorial-filtering

我拿了那个代码,我运行了索引文件,我可以看到它工作正常,所以我只是复制了列表并拿走了他的 main.js 内容并与我已经拥有的内容结合以获得这个功能:

$(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,duration: 800,easing: 'easeInOutQuad'});”

知道需要做什么吗?

最佳答案

包含 jQuery 的第二个副本会导致前一个副本及其所有插件被覆盖。删除其中一个可以解决问题。

关于javascript - Jquery: Uncaught TypeError: Object #<Object> 没有方法 'quicksand',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10338513/

相关文章:

javascript - eclipse 刻草图 : Columns will resize, 但行不会。 (CSS 网格)

javascript - 使用带有纯 JavaScript 的类禁用鼠标双击

javascript - 您如何称呼 Oracle 使用的顶部导航菜单?

jquery - 如何使用 jQuery for iframe 捕获点击事件?

javascript - 自定义提示功能尚未完成

javascript - 旋转 D3 SVG 以对齐特定 Angular

javascript - Html 页面迷你 map 或 map 概览

javascript - Rubyracer(Ruby 的 V8 绑定(bind))执行速度非常慢

javascript - 警报或模态屏幕 JavaScript

javascript - 单击事件在 svg 路径上不起作用