Board Thread:Support Requests - Getting Technical/@comment-4712589-20130823152202

Hey all,

I'm having an error with an animation I've coded. I want the animation to have a hover over effect, but currently when ever you hover over the div it just adds it to a queue. So it a user hovers over multiple timers and pulls the cursor away, the animation just keeps going. This can be seen on my sandbox. If anyone could help me resolve this, it would be highly appreciated, and might result in a cookie :)

I tried using an if statement and timer to stop the hover function whilst the previous hover animation was still going, but it doesn't seem to work. The code just keeps allowing the hover function regardless of the variable's true/false function. The code I used is as follows:

var hoverSafe = true; function resetTimer {       hoverSafe = true; } if (hoverSafe != false) { $(".testbox").mouseover(function{               magentaAnimate                cyanAnimate        }).mouseout(function{                hoverSafe = false;                setTimeout(function{resetTimer},10000);        }); } else {       jQuery.noop }  