I have the following for drag over:
$(window).on('dragover', this.onDragOver);
Is there a drag out or something similar, I need to fire an event for when the user moves off the window.
Definition and Usage. The ondragover event occurs when a draggable element or text selection is being dragged over a valid drop target. By default, data/elements cannot be dropped in other elements. To allow a drop, we must prevent the default handling of the element. This is done by calling the event.
If the mouse is released over an element that is a valid drop target, that is, one that cancelled the last dragenter or dragover event, then the drop will be successful, and a drop event will fire at the target. Otherwise, the drag operation is cancelled, and no drop event is fired.
Occurs when an object is dragged out of the control's bounds. public: event EventHandler ^ DragLeave; C# Copy.
It sounds like you're looking for the dragleave event. From the docs:
The
dragleave
event is fired when a dragged element or text selection leaves a valid drop target.
I would try one of these two events:
focus out http://api.jquery.com/focusout/
or
mouse leave http://api.jquery.com/mouseleave/
There is a dragleave event, but it's more like the opposite of dragenter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With