KillerFish
KillerFish

Reputation: 5160

problem with jquery animate function help

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

Upvotes: 0

Views: 61

Answers (2)

Spiny Norman
Spiny Norman

Reputation: 8327

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

Upvotes: 1

Matt
Matt

Reputation: 7249

Try going to the positive of left.

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

my bad, try that

Upvotes: 0

Related Questions