Can anyone tell me how I can write a function in accept condition and then how does it finds out that what to accept and what not to accept.
For example, I want to accept div a
and div b
in accept condition. How can I write I through a function?
If you want the droppable to accept a selection of elements you can do something like this:
$(".droppable").droppable({
accept: function(d) {
if(d.hasClass("foo")||(d.attr("id")=="bar")){
return true;
}
}
});
This droppable will accept elements with the class "foo" or an element with the id "bar"