The solution is to leave
animate(properties, [Options])
format ,
and use instead
animate(properties [, duration ] [, easing ] [, complete ])
format .
This allows us to perform several animations at the same time (for example, UP and RIGHT), as well as issue callback functions (in the [, complete]
parameter), then to perform another set of simultaneous animations (for example, DOWN and RIGHT).
Here is a successful violin .
JQuery for animated sine wave:
$("#sign1").animate({ left: [ '+=8%', 'linear' ], top: [ '+=5%' , 'swing' ] }, 1000, null, function() { $(this).animate({ left: [ '+=8%', 'linear' ], top: [ '-=5%' , 'swing' ] }, 1000, null, function() { $(this).animate({ left: [ '+=8%', 'linear' ], top: [ '+=5%' , 'swing' ] }, 1000, null, function() { $(this).animate({ left: [ '+=8%', 'linear' ], top: [ '-=5%' , 'swing' ] }, 1000, null, function() {
source share