Jquery UI multidraggable

Jquery UI multidraggable

Hello,
I´m German, so sry for english

I´m using the native Drag and Drop from HTML 5 for my Website: http://planning.pytalhost.de/

Dropfunction:
  1. function drop(ev)
  2. {
  3.     ev.preventDefault();
  4.     ziel = ev.target.getElementsByClassName('activity');
  5.     if(ev.target.tagName == "TD" && ziel.length == 0) {
  6.         data=ev.dataTransfer.getData("Text");
  7.         quellElement = document.getElementById(data);
  8.         zieltd = quellElement.parentNode;
  9.         if(zieltd.classList[0] != "planning") {
  10.             newDiv = quellElement.cloneNode(true);
  11.             newId = newDiv.id.substring(4);
  12.             newId++;
  13.             newDiv.id = "drag"+newId;
  14.             zieltd.appendChild(newDiv);
  15.         }
  16.         ev.target.appendChild(quellElement);
  17.     }
  18. }

I needed an multidraggable function and found this:

  1. $(window).load(function(){
  2.     var selectedObjs;
  3.     var draggableOptions = {
  4.         start: function(event, ui) {
  5.             //get all selected...
  6.             if (ui.helper.hasClass('selected')) selectedObjs = $('div.selected');
  7.             else {
  8.                 selectedObjs = $(ui.helper);
  9.                 $('div.selected').removeClass('selected')
  10.             }
  11.         },
  12.         drag: function(event, ui) {
  13.             var currentLoc = $(this).position();
  14.             var prevLoc = $(this).data('prevLoc');
  15.             if (!prevLoc) {
  16.                 prevLoc = ui.originalPosition;
  17.             }
  18.             var offsetLeft = currentLoc.left-prevLoc.left;
  19.             var offsetTop = currentLoc.top-prevLoc.top;
  20.             moveSelected(offsetLeft, offsetTop);
  21.             $(this).data('prevLoc', currentLoc);
  22.         }
  23.     };
  24.    
  25.     // Klasse welcher die Dragfunktion zugewiesen wird
  26.     $('.activity').draggable(draggableOptions).click(function(){$(this).toggleClass('selected')});
  27.     function moveSelected(ol, ot){
  28.         console.log("moving to: " + ol + ":" + ot);
  29.         selectedObjs.each(function(){
  30.             $this =$(this);
  31.             var p = $this.position();
  32.             var l = p.left;
  33.             var t = p.top;
  34.             console.log({id: $this.attr('id'), l: l, t: t});
  35.             $this.css('left', l+ol);
  36.             $this.css('top', t+ot);
  37.            
  38.         })
  39.     }
  40. });

but i cant´t found anyway or have any idea´s to add my drop function to this example, i´m a newbie in Javascript and need help.

Can anyone help me?

big thx!