13

I've got a bit of a bug. Well, the code on jsfiddle speaks for itself, to provoke the bug move your mouse quickly over the red box (to one side or the other).

A quick explanation: I have a list of items, when i hover them i show an overlay div on their positions, i bind an mouseenter on the list item, and an mouseleave on the overlay div, but if you move the cursor to fast, the mouseleave is never triggerd.

Any ideas? Thanks!

http://jsfiddle.net/QH3LV/22/

Christian Werther
  • 336
  • 1
  • 2
  • 12
  • I cannot reproduce this bug, but you might try setting a timeout to hide the overlay div, and clear the timeout on both mouseover on the list item, and mouseleave on the overlay. See http://stackoverflow.com/questions/1273566/how-do-i-check-if-the-mouse-is-over-an-element-in-jquery/1670561#1670561 – GregL Sep 07 '11 at 09:51

1 Answers1

6

This is what you are looking for.

There should be no problem in placing the hidden div inside the li tag

AlexBay
  • 1,323
  • 2
  • 14
  • 26
  • The bug still occurs when your inside the document.body, any other suggestions? – Christian Werther Sep 07 '11 at 11:03
  • Edited: try the new demo. Is this ok? – AlexBay Sep 07 '11 at 11:21
  • 1
    @AlexBay would you be kind enough to explain why this is happening? I'm experiencing a similar problem here: http://stackoverflow.com/questions/15216637/any-idea-why-mouseleave-event-is-not-registering-when-moving-the-cursor-fast - the fiddle is here: http://jsfiddle.net/abitdodgy/7rFb6/1/ – dee Mar 05 '13 at 05:52
  • @dee I added a reply to your question, check it out. – AlexBay Mar 05 '13 at 11:00