views:

82

answers:

1

$(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?

A: 

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)}]);
thephpdeveloper
no, in the other way, I want to trigger "as it would be" the user who dropped a item, not a user by himself.
Codler