该元素有时会停止拖动,当我在onStart方法中检查事件时它具有event.currentTarget = document,有时会发生这种情况,例如当我在本地服务器上检查它时,它会正常工作并在event.currentTarget中发送该元素。 / p>
<div style="margin-bottom: 10px; padding: 0px;" id="labelElement">
<img src="image/text.png" data-drag="true" class="drag-element font-margin" style=""
data-jqyoui-options="{revert: 'invalid'}"
jqyoui-draggable="{ animate:false, placeholder:'keep',deepCopy:true, onStart:'ctrl.calculatePointerOffset()'}"
ng-model="ctrl.label"><br/>
<span style="color: #2aabd2;">{{strings.textBox}}</span><br>
</div>
ctrl.calculatePointerOffset = function (event,ui) {
ctrl.offsetX = event.pageX - ui.offset.left;
ctrl.offsetY = event.pageY - ui.offset.top;
};