i'm trying to achieve the same effect as on imgur.com (drag a file from the desktop to imgur.com and you'll see a cool overlay). already have a working solution thanks to this post: Event propagation, overlay and drag-and-drop events
BUT: i find the solution rather unsatisfying. the problem is $(document).on('dragenter') gets fired multiple times when hovering over child elements. i was looking for an event that gets fired ONCE when i enter the viewport and ONCE when i leave the viewport so i could have a clean $overlay.fadeIn() and .fadeOut() on dragenter and dragleave.
i solved it with a transparent element that fills the whole viewport. i then call dragenter on that transparent element instead of on $(document). with $('*:visible').live('dragenter') i then show the hidden and the real overlay. $('#transparentOverlay').on('dragleave') hides the overlays. pretty hacky but it works (at least in safari/chrome/firefox)
but just the selector $('*:visible').live() gives me a headache...
anyone have a better suggestion?