I am using packery with infinitescroll and it works well but I can't get draggabilly to work with the appended elements. I'm sure I am wrong on the callback to include dtaggabilly on the new elements
Packery code:
var $container = $('#container');
var pckry = new Packery( container, {
// options
itemSelector: '.item',
gutter: 10,
columnWidth: 185,
rowHeight: 185
});
imagesLoaded( container, function() {
pckry = new Packery( container );
});
var itemElems = pckry.getItemElements();
// for each item...
for ( var i=0, len = itemElems.length; i < len; i++ ) {
var elem = itemElems[i];
// make element draggable with Draggabilly
var draggie = new Draggabilly( elem );
// bind Draggabilly events to Packery
pckry.bindDraggabillyEvents( draggie );
}
my infinite scroll callback:
function( newElements ) {
$(newElements).imagesLoaded( function() {
pckry.appended( newElements );
});
var itemElems = pckry.getItemElements();
// for each item...
for ( var i=0, len = itemElems.length; i < len; i++ ) {
var elem = itemElems[i];
// make element draggable with Draggabilly
var draggie = new Draggabilly( elem );
// bind Draggabilly events to Packery
pckry.bindDraggabillyEvents( draggie );
}
}
I am using packery with infinitescroll and it works well but I can't get draggabilly to work with the appended elements. I'm sure I am wrong on the callback to include dtaggabilly on the new elements
Packery code:
my infinite scroll callback: