17

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.

1

3 Answers 3

27

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.

1
  • Thanks, but drag leave seems to fire when I enter the wind for the first time, is there a way around this?
    – panthro
    May 21, 2014 at 17:29
3

I would try one of these two events:

focus out http://api.jquery.com/focusout/

or

mouse leave http://api.jquery.com/mouseleave/

2

There is a dragleave event, but it's more like the opposite of dragenter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.