Hi John,

If I change my time to 1 then both demos do work the same. But I still
think this is a bug in 1.3_b1.

I queue up 3 animations, and use tail recursion so they happen one at
a time. In 1.3_b1 the 2nd and 3rd animations happen simultaneously,
but not in 1.2.6. Here's the code:

(function ($) {

$(document).ready(function(){
  $('#concentration').click(function (event) {
    doFlip([
      {action: 'flip', card: $('#c1'), animationSpeed: 0}, // <<==
animationSpeed >0, things work
      {action: 'flip', card: $('#c0'), animationSpeed: 1000},
      {action: 'flip', card: $('#c1'), animationSpeed: 1000}]);
  });
});

function doFlip(flips) {
  var flip
  var $card, $up, $down;
  if (flips.length === 0) { return; } // <<== termination condition
  flip = flips.shift();
  switch (flip.action) {
  case 'flip':
    $card = flip.card;
    $up = $card.find('.jqConcentrationUp');
    $down = $card.find('img').not('.jqConcentrationUp');
    $up.addClass('jqConcentrationUp-last');
    $down.css({opacity: 0.0}).
      addClass('jqConcentrationUp').
      animate({opacity: 1.0}, flip.animationSpeed, function () {
        $up.removeClass('jqConcentrationUp jqConcentrationUp-last');
        doFlip(flips);              // <<== recursive call for next
animation
      });
    break;
  default:
    alert('oh woe is us. flip.action="'+flip.action+'"');
    doFlip(flips); // better luck w/ next action
  }
}

})(jQuery);


On Jan 4, 9:19 am, "John Resig" <jere...@gmail.com> wrote:
> This may help you hunt down the issue, but one change that was made
> was that if a time of 0 is passed in to an animation then it happens
> instantly (no delay, no asynchronous behavior). Thus you'll probably
> want to take that into account when doing an animation like that.
>
> I have a feeling that if you set the time to be 1 in both demos it
> would work identically.
>
> --John
>
> On Sun, Jan 4, 2009 at 2:09 AM, MarionNewlevant
>
> <marion.newlev...@gmail.com> wrote:
>
> > I boiled it down as much as I could. Test case is here:
> >http://newlevant.com/marion/jqueryplugins/concentrationBug/
>
> > Calling animate like so:
> > animate({opacity: 1.0}, flip.time, function () { ... });
>
> > And if flip.time is 0, subsequent calls don't wait for the animation
> > to finish before calling the animate callback.
>
> > Have not submitted a bug report (new to the whole system), but will if
> > you think I should.
>
> > (jQuery is fabulous by the way. Plugin where I found this bug is here:
> >http://newlevant.com/marion/jqueryplugins/concentration/)
>
> > Marion
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to