twsJames
twsJames

Reputation: 425

jquery Hover bug

I'm trying to write a piece of Jquery that will change something when the user hovers on/hover off a div.

However if i hover off the div during the animation the hover on animation the off animation does not work

$('.boxgrid').hover(function(){
    $(".cover", this).stop().delay(1000).animate({top:'80px'},{queue:true,duration:500});
}, function() {
    $(".cover").stop().animate({top:'130px'},{queue:false,duration:0});
});

Am I doing anything wrong?

Thanks in advance.

Upvotes: 0

Views: 736

Answers (2)

Alex
Alex

Reputation: 7374

http://jsfiddle.net/CKrPF/ - does this not work correctly?

Upvotes: 0

mattsven
mattsven

Reputation: 23303

Try changing your .stop()'s to .stop(true, true).

Upvotes: 1

Related Questions