views:

1662

answers:

2

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
can you confirm this works on hover? it works on unbinding click, but not working on the hover function.
zsharp
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
+1  A: 
function test(){ alert('test'); };

$( "li" ).hover( test );

$("li").unbind('hover', test);
Bruno Aguirre
hover is not a real JavaScript event, and can't be unbound like that.
bdukes