I need to shake div and animate its background-color color at the same time.
Here is the JSFiddle example: http://jsfiddle.net/EUz4z/
$("#test").effect("shake", {}, 500 ).css("background-color","red").animate({backgroundColor: old_bg}, 500 );
})
You can use the queue: false
option:
$(document).ready(function(){
$("#but").click(function(){
old_bg=$("#test").css("background-color");
$("#test").effect("shake", { }, 500 )
.css("background-color","red")
.animate({backgroundColor: old_bg}, {duration: 500, queue: false } );
})
});