Unfortunately this won't work when using the hover helper method. The hover
helper method assigns an anonymous method to both the mouseover and mouseout
events. This anonymous function then decides if it should fire the given
mouseover or mouseout functions provided to .hover().

--
Brandon Aaron

On 6/22/07, Erik Beeson <[EMAIL PROTECTED]> wrote:


In addition to Brandon's suggestion, you could also used named
functions instead of anonymous functions if you only want to remove
the hover events instead of all mouseover/mouseout events:

function hoverOn() {
   ...
}
function hoverOff() {
   ...
}

$(...).hover(hoverOn, hoverOff);
$(...).unbind('mouseover', hoverOn).unbind('mouseout', hoverOff);

But probably the easiest way to deal with it is to have your hover
functions check some state before doing the hover effects, and then
don't worry about unbinding them:

$(...).hover(function() {
  if(/* check for something */) {
      // do hover stuff here
   }
}, function() {
  if(/* check for something */) {
      // do unhover stuff here
   }
});

The check would be specific to your application.

--Erik


On 6/22/07, March <[EMAIL PROTECTED]> wrote:
> i did something like this:
>
> $('div').hover(function(){
>     // do something
> },function(){
>     // do something else
> });
>
> but after some event, i need to disable the hover effect, is there any
easy
> way to do this?
>
> thanks
>
> --
> Zacky Ma
> www.marchbox.com

Reply via email to