本文介绍了同位素库错误:未捕获错误没有布局模式包装行8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将packery用作我的图库的布局。我正在使用fancybox与同位素画廊。我没有看到fancybox成为问题。

I am trying to use packery as a layout for my gallery. I am using fancybox with the isotope gallery. I don't see fancybox being the issue.

我正在使用isotope v2和最新的packery下载。每一个其他布局都可以工作,甚至不包括在像fitRows和fitColumns这样的同位素js中。但随着包装我从同位素得到这个错误:

I'm using isotope v2 and the latest packery download. Every single other layout works, even the ones not included in isotope js like fitRows and fitColumns. But with packery I get this error from isotope:

未捕获错误:没有布局模式:packery isotope.pkgd.js第8行

Uncaught Error: No layout mode: packery isotope.pkgd.js line 8

以下是codepen的示例:

Here is an example on codepen: http://codepen.io/anon/pen/QwXEvr

JS:

jQuery('.fancybox').fancybox({
        openEffect: 'none',
        closeEffect: 'none'
    }); 

$('#testing').isotope({
   'layoutMode': 'packery';
  'itemSelector' :'.item';
});


推荐答案

有两个Packery,,对于同位素和名为。您正在加载库,这会给您错误。他们不一样。下载并安装同位素包装布局js,你会发现它有效。

There are two Packery's, the packery layoutmode that you want, for isotope and the actual library called packery. You are loading the library, which gives you the error. They are not the same. Download and install the isotope packery layout js and you will see it work.

这是一个更新的

$('#testing').isotope({
'layoutMode': 'packery',
'itemSelector' :'.item'
});

这篇关于同位素库错误:未捕获错误没有布局模式包装行8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 14:02