Packery - how to change layout mode?

我的未来我决定 提交于 2019-12-22 04:29:17

问题


I'd like to use this plugin: http://packery.metafizzy.co/ with layout mode: meticulous as described on the frontpage. I went through every page of documentation and cannot find how to set it to meticulous instead of masonry layout which is default!

var $container = $('#grid_index');
// initialize
$container.packery({
  itemSelector: '.item',
  gutter: 0
});

Any ideas?


回答1:


To answer my question directly, layout mode "meticulous" is triggered automatically by setting: columnWidth and rowHeight in options.

Like this:

var $container = $('#grid_index');
var pckry = $container.data('packery');
// initialize
$container.packery({
  itemSelector: '.item',
  gutter: 0,
  "columnWidth": 250,
  "rowHeight": 250
});


来源:https://stackoverflow.com/questions/18871162/packery-how-to-change-layout-mode

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