I have a problem with jQuery-UI draggables and droppables. I need to drag a draggable inside a droppable that fits inside an iframe. This works fine until I scroll through the iframe. Dropped coordinates are not updated.
The problem is demonstrated in this fiddle.
I use the workaround below to make dragging and dropping into iframes possible in the first place. It calculates the correct offsets, but does not use iframe scroll offsets. I tried, but could not configure it, so it would take a scroll offset.
// Create new object to cache iframe offsets $.ui.ddmanager.frameOffsets = {}; // Override the native `prepareOffsets` method. This is almost // identical to the un-edited method, except for the last part! $.ui.ddmanager.prepareOffsets = function (t, event) { var i, j, m = $.ui.ddmanager.droppables[t.options.scope] || [], type = event ? event.type : null, // workaround for
Does anyone have a suggestion to fix the problem. Recommendations for achieving the same in a different way are also welcome.
javascript jquery jquery-ui offset iframe
Boyd
source share