metafizzy / packery

:bento: Gapless, draggable grid layouts
https://packery.metafizzy.co
4.13k stars 315 forks source link

access gaps array with jQuery init #551

Closed netzproductions closed 3 years ago

netzproductions commented 3 years ago

@desandro, you mentioned using pckry.packer.spaces to get access to all gaps rendered. Would you please so kind to tell how to get the spaces array using jQuery init? Thanks in advance, Alex

desandro commented 3 years ago

Use .data('packery') to get the Packery instance pckry

let pckry = $grid.data('packery');
console.log( pckry.packer.spaces )