javascript - Changing DOM order after drag and drop with packey and draggabilly -


itemprop = "text">

There is a bug on this code

  docReady (function (); On top pckry = new packery (slidesElem, {rowHyight: slideSize.outerHeight}); / varSelector ('slide.'); SlideSize = getSize (document.querySelector ('Slide.')); / Item items on itemElems = pckry.getItemElements (); // for each item (for example, I = 0 lane = itemElems.length; I & lt; lane; i ++) {var = ItemElems [i]; // Elements Draggabilly draggie with draggie to make = Draggabilly (ELEM, {axis: 'y'}); // Packery pckry.bindDraggabillyEvents (draggie) bound to draggabilly events;} // Once again the item is in the position after the dom pckry.on ('dragItemPositioned', function (_pckry, draggedItem) {var index = pckry.items.indexOf (draggedItem); nextItem = pckry.items [index + 1] ; SlidesElem.inser first (dragged itam.lim, next etam.liment);});});  

When I drag the "first" item to "last", the DOM does not change and the error appears in the console.

Any thoughts? I'm really struggling to find the error.

I appreciate all your help

using the sample:

You do not need to change the index, it should be just

  on nextItem = pckry.items [index];  

dragged item returns to the index where you put it / where the next item


Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

class - Kivy: how to instantiate a dynamic classes in python -

python - mayavi mapping a discrete colorbar on a surface -