Side navigation
#1545 closed bug (wontfix)
Opened August 28, 2007 11:03AM UTC
Closed December 16, 2007 08:47PM UTC
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: |
Description
Please see example page:
http://goldenman.spb.ru/development/jquery/bug_unbind/
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)
Change History (7)
Changed September 27, 2007 10:22PM UTC by comment:1
Changed November 18, 2007 11:50PM UTC by comment:2
resolution: | → worksforme |
---|---|
status: | new → closed |
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.
Changed November 27, 2007 04:07PM UTC by comment:3
resolution: | worksforme |
---|---|
status: | closed → reopened |
Your test case is not completely proper.
$("#s1").unbind("mouseout");
- 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:
http://goldenman.spb.ru/development/jquery/bug_unbind/index2.html
Changed November 27, 2007 06:27PM UTC by comment:4
owner: | → davidserduke |
---|---|
status: | reopened → new |
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):
http://groups.google.com/group/jquery-dev/browse_thread/thread/ac05a5cac97913ab#f2e2221786fb0d91
I'll leave the bug open for now and hopefully be able to close it soon. :)
Changed November 27, 2007 06:27PM UTC by comment:5
milestone: | 1.2 → 1.2.2 |
---|
Changed December 07, 2007 04:16AM UTC by comment:6
component: | core → event |
---|
Changed December 16, 2007 08:47PM UTC by comment:7
resolution: | → wontfix |
---|---|
status: | new → closed |
The event code has changed so there is now a workaround for this issue. Change
$(...).hover(fnOver, fnOut);
to
$(...).bind('mouseenter.mynamespace', fnOver).bind('mouseleave.mynamespace', fnOut);
That will do the same thing and allow you to namespace the event.
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.
http://dev.jquery.com/ticket/1731