6

How can I bind a function on the drop event, but outside of the droppable() function?

$('#list').droppable({
    // ...      
    drop: function(e,ui) {
       // this works...
    },
});


// ..but I want to bind my function here

Is this possible?

Romain Guidoux
  • 2,943
  • 4
  • 28
  • 48
Alex
  • 66,732
  • 177
  • 439
  • 641
  • well the problem is that I have not control over that droppable function, that's why I need to do this from outside... – Alex Dec 27 '11 at 21:30

1 Answers1

5

Yes, absolutely. Bind to the "drop" event as you would any other event.

$( "#list" ).bind( "drop", function(event, ui) {
  ...
});
Interrobang
  • 16,984
  • 3
  • 55
  • 63