Bug Tracker

Opened 16 years ago

Closed 16 years ago

#1545 closed bug (wontfix)

unbind doesn't work if hover uses

Reported by: golden Owned by: davidserduke
Priority: minor Milestone: 1.2.2
Component: event Version: 1.1.4
Keywords: event mouseout hover Cc:
Blocked by: Blocking:


Please see example page:


2 span tags has binded mouseover and mouseout handlers. The first of them uses chain of mouseover, mouseout invokes. The second uses hover method to bind handlers. Then for both tags immediately unbinding of mouseout handler invokes. However for first tag it works proper, but for second it doesn't work.

Attachments (1)

jquery_test.html (1.0 KB) - added by davidserduke 16 years ago.
test case based on how I read the description

Download all attachments as: .zip

Change History (8)

comment:1 Changed 16 years ago by davidserduke

The example page is a broken link so it's difficult to say but this may be related to this ticket about hooking multiple events since hover hooks both mouseout and mouseover.


Changed 16 years ago by davidserduke

Attachment: jquery_test.html added

test case based on how I read the description

comment:2 Changed 16 years ago by davidserduke

Resolution: worksforme
Status: newclosed

The test case I created based on the description works for me. If this test case doesn't reflect the actual bug then please reopen ticket with an appropriate test case.

comment:3 Changed 16 years ago by golden

Resolution: worksforme
Status: closedreopened

Your test case is not completely proper.

  • this code unbinds all handlers that are binded for this element on this event.

But in my page I tried to unbind only specific handler:

$('#bbb').unbind('mouseout',out); // !!! 2nd parameter important !!!

Please, look on the new sample page:


comment:4 Changed 16 years ago by davidserduke

Owner: set to davidserduke
Status: reopenednew

Ah I see what you mean. Yes that will fail since hover isn't a true event but rather a helper function. There is currently work being done to make what you want to do possible (if it makes it into the core):


I'll leave the bug open for now and hopefully be able to close it soon. :)

comment:5 Changed 16 years ago by davidserduke


comment:6 Changed 16 years ago by brandon

Component: coreevent

comment:7 Changed 16 years ago by davidserduke

Resolution: wontfix
Status: newclosed

The event code has changed so there is now a workaround for this issue. Change

$(...).hover(fnOver, fnOut);


$(...).bind('mouseenter.mynamespace', fnOver).bind('mouseleave.mynamespace', fnOut);

That will do the same thing and allow you to namespace the event.

Note: See TracTickets for help on using tickets.