我有一些拖动对象和放置对象的数组,这里:
var elmDragObj = ["#ob01","#ob02","#ob03","#ob04","#ob05","#ob06","#ob07","#ob08","#ob09","#ob10","#ob11","#ob12","#ob13","#ob14","#ob15","#ob16","#ob17","#ob18","#ob19","#ob20"];
var elmDropObj = ["#va_kb_a","#va_ks_a","#va_kk_a","#dk_kb_a","#dk_kb_b","#dk_ks_a","#pr_kb_a","#rv_kb_a","#rv_kb_b","#rv_kb_c","#pr_ks_a","#rv_ks_a","#rv_ks_b","#rv_ks_c","#vl_kb_a","#vl_ks_a","#vl_kk_a","#vk_kb_a","#vk_ks_a","#vk_kk_a"];
我有一个布尔数组来检查所有对象何时被放置在它的位置,这里:
var elmBool = [false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false];
当我想检查布尔值时,它是未定义的,脚本如下:
for(var j=0; j<elmDragObj.length; j++){
$(elmDragObj[j]).draggable({revert:"invalid"});
$(elmDropObj[j]).droppable({
accept: elmDragObj[j],
drop: function( event, ui ) {
alert(elmBool[j]);
}
});
}
我做错什么了吗?