Hi Wolf,

try to stop previous animations before adding a new one:
  $(this).stop().animate({...});

by(e)
Stephan

2009/2/24 Wolf <mscha...@gmail.com>:
>
> I have a strange delay issue.
>
> I'm working on a menu animation.  When a user moves their mouse to the
> top, it will move the menu up and when they move their mouse to the
> bottom, it moves it down.  When I first move the mouse over the menu,
> the animation fires.  But there is a big delay (maybe 2 seconds)
> before it will fire again, after I move my mouse back on it.
>
> However, if I change the animation speed from 2000 milliseconds to 10
> milliseconds, it will fire right away.
>
> Any Suggestions? Thx.
>
> Here is a simplified version of my code:
> $("#menu").mousemove(function(e){
>        if (e.pageY < 100) {
>                $(this).animate({
>                        top: "-200px"
>                }, 2000 );
>        }
>        if (e.pageY > 300) {
>                $(this).animate({
>                        top: "0px"
>                }, 2000 );
>        }
> });
>

Reply via email to