here is the Fiddle http://jsfiddle.net/SunMercury/pmhFv/
How can I declare an object id and startValueX, startValueY, endValueX, endValueY first
then it will animate using my declared values?
animateMe($(‘#box1’), 2000);
to
animateMe($(‘#box1’), startValueX, startValueY, endValueX, endValueY, 2000);
You practically have it… Just add your parameters to your function declaration, and replace the hard-coded values in the function with those parameter names:
http://jsfiddle.net/bQVUH/