How to kill .animate() after the user hovers off?
Code:
//create the animation.
$('img#header').hover(function(){
$(this).animate({"top": "-10px" }, "slow");
I am trying to have the hover stop and go back t开发者_如何学编程o normal when the user hovers off the image. I got the animation working, just not when I hover off. Any help?
$('img#header').hover(function()
{
$(this).animate({"top": "-10px" }, "slow");
}, function()
{
$(this).animate({"top": "0"}, "slow");
});
精彩评论