English 中文(简体)
j 具有不同期限的多种分析 但是, runs然相反。
原标题:jQuery Multiple Animations with Different Duration, But runs simultaniously
  • 时间:2011-02-24 15:02:17
  •  标签:
  • jquery

我怎么能够有2个或2个以上不同期限的动画,但同时也开始。

when I do something like (for example)

$("#something").animate({opacity: 1}, 2500).animate({left: 1000}, 10000);

只有在不透明估计完成后,才开始移动。

最佳回答

http://api.jquery.com/animate/“rel=“nofollow” 您可以设定一个名为<代码>queue=false的财产,以便取得你想要的效果。 修订法典:

$("#something")
.animate({opacity: 1, queue: false}, 2500)
.animate({left: 1000 +"px", queue: false}, 10000);

我希望:

PS。 一种推测带有queue=false 财产,因此,你可以将物体的其他消化。 在此情况下,您可能会wan缩到跳跃上最后一刻的<代码>queue=fal>,因此,链式的估算只能从词汇中得出最长的估算。 例如,如果在你目前估计之后,你也想把高点推到一起:

$("#something")
.animate({opacity: 1, queue: false}, 2500)
.animate({left: 1000 +"px"}, 10000)
.animate({height: 500 +"px"}, 1000);

这样,<条码>八<>/代码>只有在条码/代码终止后才算。

问题回答

http://docs.jquery.com/Release:jQuery_1.2/Effects#Simultaneous_Animations”rel=“nofollow” http://docs.jquery.com/Release:jQuery_1.2/Effects#Simultaneous_Animations

我认为,这样做是trick的,尽管你可能只需要 que子:一种 an的虚假财产。

$("#something")
    .animate({opacity: 1}, {queue: false, duration: 2500})
    .animate({left: 1000}, {queue: false, duration: 10000});

问题

$("#something").animate({opacity: 1,left:1000}, 2500)




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签