What's the syntax for using += with a variable when using the .animate function?
I am 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:
- $('element').animate({"right" : '+=320px'}, scrollSpeed, ScrollEase);
and Here's what I'm trying to do:
- $('element').animate({"right" : +=variable}, scrollSpeed, ScrollEase);
Thanks for your help.