function moveto(step1, step2, step3) {
var w = $(document).width();
var h = $(document).height();
$('#full').animate({
left: -(step1 * w)}, {
duration: 1000,
});
$('#full').animate({
top: -(step2 * h)
}, {
duration: 1000,
});
}
I need this function to animate once then do another animate with different step.
You have to chain the animations using the complete callback :
Here’s a demo: http://jsfiddle.net/RHCqQ/