PDA

View Full Version : How to add break for jQuery plugin??



XManBG
08-27-2011, 08:13 PM
Hello again with one 'little' question :)

I've written a jQuery plug-in for background color animation, which is good working, but...

There is always a "but": if I start the same plug-in quickly twice, for one and the same HTML element, the effect is performed only once - for the first start. Take a look at the example page, where on mouseover the div bg-color starts to animate to yellow, and on mouse out should animate to black. If you move the mouse quickly away, just before the first animation is done, the second don't start (or is overrun...)

How could I integrate a queue, or how could I just interrupt the first run of the plug-in, when a second run is initiated?!

http://www.x-mediapro.de/colorrotatortest/coloranimation.html