Ticket #5821 (closed bug: fixed)
mouseenter/leave behave like mouseover/out with live events
| Reported by: | korchev | Owned by: | brandon |
|---|---|---|---|
| Priority: | low | Milestone: | 1.5 |
| Component: | event | Version: | 1.4 |
| Keywords: | Cc: | akorchev@… | |
| Blocking: | Blocked by: |
Description
The description says it all. Please check the attached repro file.
Attachments
Change History
comment:1 Changed 3 years ago by alexgyoshev
fix committed at GitHub, http://github.com/gyoshev/jquery/commit/aa08149057831c1a81ab16b430a77f64ecc4eae2
comment:2 follow-up: ↓ 3 Changed 3 years ago by rwaldron
- Priority changed from major to low
- Status changed from new to closed
- Resolution set to fixed
This issue no longer exists
comment:3 in reply to: ↑ 2 Changed 3 years ago by akorchev@…
No, the problem still exists. Your code is using delegate. You need to use live events and nested elements with the same class. Here is the jsfiddle.net based example which fails in the same way as the initial case: http://jsfiddle.net/QUNQT/ Use the mouse to enter the parent element and then the child one. See what gets logged in the console.
comment:4 Changed 3 years ago by rwaldron
- Milestone changed from 1.4.1 to 1.4.5
Sorry, I linked to the wrong fiddle. This is the correct fiddle, I've also updated it to use the 1.4.4rc1
http://jsfiddle.net/rwaldron/m7qxf/
Following your instructions, here is the result:
mouseenter outer
mouseleave outer
mouseenter inner
mouseleave inner
mouseenter outer
mouseleave outer
comment:5 Changed 3 years ago by akorchev@…
Should't the result be a bit different? I expect to see this: mouseenter outer mouseenter inner mouseleave inner mouseleave outer
If I change live to bind I get the desired behavior. I have updated the examples to show you: 'bind' version: http://jsfiddle.net/V8jpL/ 'live' version: http://jsfiddle.net/ct95u/1/ Also note that both divs are using the same class.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

