我的对象中有一个函数。
我想从另一个函数访问这个函数的变量。有人可以帮我吗?
这是我的示例代码。任何帮助将不胜感激。谢谢。
var drops= {
hoverClass: "hoverme",
greedy: true,
accept: "#mini",
drop: function(event,ui){
var droppedOn2 = $(this);
var dropped2 = $(ui.draggable);
alert(droppedOn2.attr('id')); alert(dropped2.attr('id'));
$(dropped2).appendTo(droppedOn2).draggable();
},
over: function(event, ui){
console.log("buraya geliyorum > " + this.id);
}
};
$('#hebelek').sortable({
connectWith: '#hebelek',
cursor: 'pointer'
}).droppable({
accept: '#gridIcon1-2, #gridIcon2-2, #widgetIcon',
activeClass: 'highlight',
drop: function(event, ui) {
var ilk = drops.droppedOn2;
var droppedOn = $(this);
var dropped = $(ui.draggable).clone();
var fileName = dropped.attr('id');
alert(droppedOn.attr('id')); alert(fileName);
if (fileName == "gridIcon1-2"){
$(grid1_2Div).appendTo(droppedOn).find('.gridcell').droppable(drops)
};
if (fileName == "gridIcon2-2") {
$(grid2_2Div).appendTo(droppedOn).find('.gridcell').droppable(drops)
};
if ((fileName == "widgetIcon") && (droppedOn.attr('id') == "hebelek")) {
$(widgetDiv).appendTo("I WANT TO USE DROOPEDON2 ON HERE")
};
}
});