Html5 DND and Jquery MouseLeave Event not firing -


i've experienced weird issue browsers , not sure how fixed it. using jquery's mouseleave event on outer div let's me catch event when pointer leaves div without firing children. works great, however, adding draggable inner div , dragging outside result in strange behaviors:

  • latest chrome: not firing mouseleave when leaving, not after releasing mouse
  • firefox: not firing mouseleave when leaving, after releasing mouse outside , move fires event

what i'd need mouseleave event mouse leaves container, no matter whether dragging or not.

here's relevant jquery code used testing:

$('#outer')     .on('mouseenter', function () {     $('label').text('mouse entered'); })     .on('mouseleave', function () {     $('label').text('mouse left'); });  $('#dragger')     .on('dragstart', function (evt) {     evt.originalevent.datatransfer.effectallowed = 'move';     // dummy data browser may not drag otherwise     evt.originalevent.datatransfer.setdata('text/plain', ''); }); 

relevant test case can seeen here: http://jsfiddle.net/w5dgg/1/

figured the answer. stated on https://developer.mozilla.org/de/docs/dragdrop/drag_and_drop:

a number of events used fired during various stages of drag , drop operation. note drag events fired; mouse events such mousemove not fired during drag operation.

so, no mousemove event , jquery can not fire mouseleave event. bad :(


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -