I'm trying my luck at some basic animation following a basic tutorial over here.
In this tutorial, an object moves one way, then returns. Fairly simple.
What I'd like to do however is have that basic animation going on, while applying another animation simultaneously.
For example, as the ball is going left to right at say 500ms a transition, there is another animation going on which happens every 3000ms, perhaps it is going up and down a little bit. I am doing this to create an irregular pattern.
I tried doing something like this:
(this is using jquery and the timers plugin)
$( "#ball1") .everyTime ( 10, function (){
$("#ball1") .animate ({top:"60px"}, 6000 ).animate ({top:"57px" }, 6000 );
$("#ball1") .animate ({left:"5px" }, 9000 ).animate ({left:"0px" }, 9000 );
});
And also:
$( "#ball1") .everyTime ( 10, function (){
$("#ball1") .animate ({top:"60px"}, 6000 ).animate ({top:"57px" }, 6000 );
});
$( "#ball1") .everyTime ( 10, function (){
$("#ball1") .animate ({left:"5px" }, 9000 ).animate ({left:"0px" }, 9000 );
});
In both cases it seems that the first animation finishes, then the next one starts... then it loops, rather than at the same time.
What am I missing or what do I need to research to do this?
Thanks for your time!