Search code examples
jqueryjsplumb

Recreating diagrams


If I want to recreate the diagram I made with dragging elements using jsplumb, I can send the anchor's positions.. But I was wondering how can I send the exact position of the draggable element. In the beginning I tell where to place these elements but in the proces of drag and drop I move them around the canvas and then when I 'save' the diagram I want to memorize the current postion of the element, not the starting.


Solution

  • just trigger something like that, when you press the save button:

    $('.your elements').each(function(){
        var elementPositionX = $(this).css('left');
        var elementPositionY = $(this).css('top');
    }