开发者

Simultaneous `.animate()` and `.effect()`

开发者 https://www.devze.com 2023-03-23 08:07 出处:网络
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:

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 );
0

精彩评论

暂无评论...
验证码 换一张
取 消