I really wasn't interested in what that function does.    I would recommend starting over with your own code so you know how everything works. You don't rotate each individual div. You rotate the outer div. As an item reaches the top, you change it's z-index.   Here are some demos that might help you get started. They don't change the z-index, but it would be done in a onDrag callback for the draggable instance.   See the Pen 0a3823c56edb6b8e560e8
    • Like
    3