【问题标题】:Using Isotope plugin with requirejs将 Isotope 插件与 requirejs 一起使用
【发布时间】:2014-08-07 08:47:56
【问题描述】:

我已使用以下说明添加了同位素插件:http://isotope.metafizzy.co/appendix.html#requirejs

这是我的代码:

this.social = new Isotope('#latest-news', {
    itemSelector: '.social-item',
    layoutMode: 'fitRows',
    sortBy: 'text',
    getSortData: {
       'text': '.text'
    }
});

然后我稍后尝试像这样插入元素:

that.social( 'insert', elements );

但得到以下错误(关于插入功能):

Uncaught TypeError: undefined is not a function 

如果我执行 console.log(this.social),它会返回一个同位素对象。

我如何调用“插入”函数或任何函数?否则我哪里错了?

【问题讨论】:

    标签: backbone.js marionette require jquery-isotope


    【解决方案1】:

    浏览了一下源码,使用requirejs的时候insert方法变成了:

    that.social.insert( 元素 );

    基本上使用 vanilla JS 版本的方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-10-06
      • 2023-04-09
      • 2015-04-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多