I want to disable the hover event on a particular list when another event occurs.
+7
A:
You can use the unbind
function to remove those events.
$('#theListId').unbind('mouseenter').unbind('mouseleave');
bdukes
2009-04-08 20:54:21
can you confirm this works on hover? it works on unbinding click, but not working on the hover function.
zsharp
2009-04-08 21:23:12
I've updated my answer to the correct syntax. I got the previous code from http://docs.jquery.com/Events/hover#examples, but apparently you can't actually combine unbind statements like that.
bdukes
2009-04-08 21:47:39
+1
A:
function test(){ alert('test'); };
$( "li" ).hover( test );
$("li").unbind('hover', test);
Bruno Aguirre
2009-04-08 20:55:59