2

I am trying to launch an animation with JQuery using .css. I want to turn letter left, then right, then again left and right while it will be moving up.

$('.envelope').click(function() {
    $(this).find('.list')
    .animate({top:'0px'},1000);
    $(this).find('.list').delay(100)
    .css({"-ms-transform":"rotate(-6deg)","-webkit-transform":"rotate(-6deg)","transform":"rotate(-6deg)"});
    $(this).find('.list').delay(200)
    .css({"-ms-transform":"rotate(6deg)","-webkit-transform":"rotate(6deg)","transform":"rotate(6deg)"});
    $(this).find('.list').delay(300)
    .css({"-ms-transform":"rotate(-6deg)","-webkit-transform":"rotate(-6deg)","transform":"rotate(-6deg)"});
    $(this).find('.list').delay(400)
    .css({"-ms-transform":"rotate(6deg)","-webkit-transform":"rotate(6deg)","transform":"rotate(6deg)"});
    });

adding link

4
  • 2
    Is it lunch time already ? Commented Jun 2, 2013 at 16:18
  • Why not use css3 animations? Commented Jun 2, 2013 at 16:20
  • It's not clear to me what is wrong. Which behavior is not working for you? Commented Jun 2, 2013 at 16:27
  • Because Internet Explorer 9, and earlier versions, does not support the @keyframe rule or animation property. Why letter is not turning left, right, left and right, but it is only turning right? Commented Jun 2, 2013 at 16:37

2 Answers 2

1

You should use jQuery.queue for this

http://api.jquery.com/jQuery.queue/

I can make you an example if you need one. Here is a good write up:

http://cdmckay.org/blog/2010/06/22/how-to-use-custom-jquery-animation-queues/

The example is doing something very similar to what you are trying to accomplish. Let me know if you can't get this working. I can throw together a quick example for you.

Sign up to request clarification or add additional context in comments.

Comments

0

The jQuery transit plugin is designed for exactly this! It is jQuery animation API compatible, but uses CSS transitions.

http://ricostacruz.com/jquery.transit/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.