views:

44

answers:

1

here is the code so far. what i want is first the #spider to easeOutBounce then start doing this animation

  $("#spider").animate({top:"-=20px"},1000).animate({top:"+=20px"}, 1000);

here is all the codes

   $(document).ready(function() {
     setTimeout("animation()",300);
  });

  function animation(){
       spider();
  }

  function spider(){
     $("#spider").animate({top: '200px' }, {queue:false, duration:600, easing:'easeOutBounce'});
      $("#spider").animate({top:"-=20px"},1000).animate({top:"+=20px"}, 1000);
      setTimeout("spider()",2000);
  }

thanks

A: 

you mean callback ??

function spider(){
   $("#spider").animate({top: '200px' }, 600, 'easeOutBounce',
       function() {
         $(this).animate({top:"-=20px"},1000).animate({top:"+=20px"}, 1000);
   });
}
Ninja Dude
yep thats what i wanted thank you
Jquery