I have a situation where inside a div
there are draggable items. However, when the parent div
is scaled using -webkit-transform
, the draggable obviously stops working properly.
I've reproduced the scenario here.
As you can see, the draggable item moves relative to the document, even though the parent is in an entirely different scale.
I have the scale (1.5
in the example) as a variable in JS, so I can use that, but where? I'd need to divide the dragging distance by the scale, right? Where could I do this?
Edit: I've tried setting a function to drag
-event, but haven't been able to figure out how to actually alter the dragging distance.
Edit2: I digged the jQuery UI source, and it seems that there's no way to do this from the event drag
:
if(this._trigger('drag', event, ui) === false) {
this._mouseUp({});
return false;
}
As you can see, the return value of the callback-function isn't stored in any way. The position of the element is changed after the callback has fired, so changing the CSS inside the callback doesn't work.
You can see the relevant code here by using in-browser search with this string:
_mouseDrag: function(event, noPropagation) {