3
$(item).droppable({
    drop: function(event, ui) {
        console.log("triggered");
    }
});

I try to call drop by

$(item).trigger("drop", [{},{draggable : $(target_item)}]);

But it doesn't work, any ideas?

Kara
  • 6,115
  • 16
  • 50
  • 57
Codler
  • 10,951
  • 6
  • 52
  • 65

2 Answers2

0

Maybe what you want to do is:

$(item).bind('dropthis', function(e){
        console.log('triggered');
}).droppable({
    drop: function(event, ui) {
        $(this).trigger('dropthis',[event, ui]);
        }
});

And call the drop event by:

$(item).trigger("dropthis", [{},{draggable : $(target_item)}]);
mauris
  • 42,982
  • 15
  • 99
  • 131
0

try out jQuery.simulate plugin

Something like this should work.

var dropZone = $("#dropZone").offset() //get dropZone's offset object
$("#dragableEle").simulate("drag", {
     dx: dropZone.left, // move to this x
     dy: dropZone.top, // move to this y
     speed:5000 // set speed
});
adardesign
  • 33,973
  • 15
  • 62
  • 84
  • Oops, I now tested and looks like its not triggering a drop, wonder why, ill try to debug, let me know if you get somewhere. – adardesign Dec 09 '10 at 14:11