Isotope Gallery Error: Uncaught Error No layout mode packery line 8

醉酒当歌 提交于 2019-12-07 23:03:55

问题


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.

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:

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

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';
});

回答1:


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.

Here is an updated codepen

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


来源:https://stackoverflow.com/questions/29541475/isotope-gallery-error-uncaught-error-no-layout-mode-packery-line-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!