Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery droppable bind function on element drop?

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?

like image 804
Alex Avatar asked Dec 27 '11 21:12

Alex


1 Answers

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

$( "#list" ).bind( "drop", function(event, ui) {
  ...
});
like image 109
Interrobang Avatar answered Sep 27 '22 20:09

Interrobang