I'm trying to animate the right margin of an element using += to continually add to the margin each time the function is called. I want the value to be a variable though and I can't figure out the syntax.
Here's what I have:
$('.wide')animate({"right" : '+=320px'}, scrollSpeed, scrollEase);
And that works but here's what I'm trying to do:
$('.wide').animate({"right" : +=variable}, scrollSpeed, scrollEase);
I'm not sure what the correct syntax is though.
Thans for your help.