Simultaneous `.animate()` and `.effect()`
I have an <input>
element for which I'm doing two things: fading the background to green using .animate()
, and shaking it using .effect()
. Here is my code:
$myInputElement.animate({backgroundColor: 'green'}, 1000).effect开发者_如何学Go( "shake", {times:3, distance:2}, 40 );
The problem is that first the background fades, and then the element shakes. How can I have two happening simultaneously?
UPDATED :
Run the 40 millisecond one first : http://jsfiddle.net/96DQ6/4/
Have you tried like this?
$myInputElement.animate({backgroundColor: 'green'}, 1000);
$myInputElement.effect( "shake", {times:3, distance:2}, 40 );
精彩评论