I am trying to trigger a drop
event only on condition that all draggables
are dropped.
drop: function(event,ui){
var dropd = "#"+ui.draggable.attr("id");
if("#a_dra" && "#b_dra" && "#c_dra" && "#d_dra" == dropd){
$("#whistle").get(0).play();
dfd.resolve();
};
},
With this code
there is a problem. It works when every div
is dropped and triggers correctly. Except when I drop only the #a_dra
and #d_dra
, it triggers as well, which is not desirable, since I need it random.
What am I missing in there?
Thanks in advance! :)