title: jsPlumb drag element position
body: <p>im using jsPlumb with jQuery</p>
  
  <p>i was wondering if there is a way to get the position of an element while and after drag and drop it within the container?</p>
  
  <p>im doing a crossover at the moment wich is working,
  but does not repaint my connectionpoints and anchors before i save the position.</p>
  
  <pre><code>&lt;script type='text/javascript'&gt;
  $(window).load(function(){
      $('#flowchartdrag".$id_kurs."').draggable({
          drag: function() {
              var parentLeft = $('#flexwrap".$dynamiccounter."').position().left;
              var parentTop = $('#flexwrap".$dynamiccounter."').position().top;
              var offset = $(this).position();
              var xPos = (offset.left - parentLeft);
              var yPos = (offset.top - parentTop );
              $('#x".$id_kurs."').val(xPos);
              $('#y".$id_kurs."').val(yPos);
  
          },
          stop: function(event, ui) {
              // Show dropped position.
              var parentLeft = $('#flexwrap".$dynamiccounter."').position().left;
              var parentTop = $('#flexwrap".$dynamiccounter."').position().top;
              var Stoppos = $(this).position();
              var left = (Stoppos.left - parentLeft);
              var top = (Stoppos.top - parentTop);
              $('#x".$id_kurs."').val(left);
              $('#y".$id_kurs."').val(top);
          },
          containment: $('#flexwrap".$dynamiccounter."')
      });
  });
  </code></pre>
  
  <p></p>
  
  <p>i tryed to use</p>
  
  <pre><code>    jsPlumb.repaint;
  </code></pre>
  
  <p>but thats not working</p>
  
  <p>that is how i would create draggable elements with jsPlumb</p>
  
  <pre><code>instance'.$dynamiccounter.'.draggable(jsPlumb.getSelector("#flexcontent'.$dynamiccounter.' .dragable"));
  </code></pre>
  
  <p>but how can i set x / y coordinates to the elements textfields to save the position into database?</p>