开发者

How to kill .animate() after the user hovers off?

开发者 https://www.devze.com 2023-01-14 16:11 出处:网络
Code: //create the animation. $(\'img#header\').hover(function(){ $(this).animate({\"top\": \"-10px\" }, \"slow\");

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");
});
0

精彩评论

暂无评论...
验证码 换一张
取 消