Thursday, January 12, 2012

jQuery buggy setTimeout animation


I'm experiencing a bug with animated elements. When you right-click on a group its name-field expands downwards so that it is revealed along with 2 other groups on the line. And then a animation puts it on the default state triggered with setTimeout() after a few seconds. However if you start clicking randomly and intensively on groups on the line without waiting the current animation to finish it breaks becomes buggy and executes much faster then the given timings!



Here's the key part of the code:




var t = window.setTimeout(function() {
for (var i = highFrontier; i > lowFrontier - 1; i--) {
jQuery(groupBoxes[i]).animate({
height: '76px'
}, 400, 'linear', function() {});
}
}, 3300);



And here's the entire application: http://jsfiddle.net/TTGr7/20/



10x for your kind help, BR

No comments:

Post a Comment