0

I am incredibly confused. Right now, I have a draggable set to:

$('li.drag').draggable();

But once is a while, I will grab an element and it will return the parent div or the parent li's id when I call e.srcElement.id on my droppable:

$('h3.drop-target').droppable({
    accept: 'li.drag',
    drop: function(e) {
        alert(e.srcElement.id);
    }
});

This is very strange, as it will work fine for the EXACT same elements on some occasions, then I will refresh and it will error, usually just on one or two, on the same ones it was just successful on. Any ideas why I am am getting sporadic behavior?

jQuery 1.8.2 and UI 1.8.24

4

1 回答 1

1

这个答案可能来得有点晚,但万一其他人来到这里需要答案。这对我们有用:

使用“ui.item.context.id”而不是“srcElement.id”

于 2013-05-03T15:56:57.460 回答