1

there is probably something obvious that im doing / not doing that would solve this but i just cant see the answer

Im attempting to run an infinite loop in an animation and keep it running while i change that div's height in a separate animate function. the issue is while the height animation is running on the ladder, the ladder's inifite loop "pauses" (for lack of a better word) and then continues after the animation of the height finishes

here's the main part of the problem, Ive taken out alot of the stuff around it for the purpose of this question

var ladderloop = function(){
                    $("#ladder").animate({
                        "background-position-y":$("#stage").height()    
                    },500, "linear", function(){
                        $(this).css({
                            "background-position-y":0
                        });
                        ladderloop();
                    });
                }
                ladderloop();

                $("#plane").delay(1000).toggle("slide", {direction:"left"}, 2000, function(){

                    $("#logo").animate({
                        "top":$("#stage").height()
                    }, 2000, function(){
                    });

                    $("#ladder").animate({
                        "height":$("#stage").height(),
                        //"background-position-y":$("#stage").height()
                    }, 2000, "linear", function(){
                        $("#stage").stop();
                    });

                });

thanks in advance, Finbar

Finbar Maginn
  • 257
  • 2
  • 11
  • 1
    Afaik, jQuery does not allow multiple, independent but concurrent animations on the same element (in the same queue). – Bergi Feb 09 '14 at 16:25
  • Ah I see, that makes sense now, would there be a way to use a wrapper around the infinitely animating div and animate the wrapper to display the rest of the infinite animation? – Finbar Maginn Feb 10 '14 at 12:16
  • Yes, that would be one of the hacky workarounds I thought of :-) – Bergi Feb 10 '14 at 13:46

0 Answers0