0

I had developed a small animation using jquery. But my problem is when i am animating a div using flowing script

$('#square').animate({left: -350+"px"},'slow');

it is working great.. But when i am replacing left with right animation is not working

$('#square').animate({right: -350+"px"},'slow');

The above is not animating any..

what might be the problem?

Thank You

2 Answers 2

1

I'm not sure, but it might very well be that you always use left. So, use left: '350px' instead of right: '-350px'.

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

Comments

0

Try going to the positive of left.

$('#square').animate({left: "=350px"},'slow');

my bad, try that

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.