Single queue for jQuery animate() elements

后端 未结 3 1185
失恋的感觉
失恋的感觉 2021-01-21 02:53

By default the jQuery queue that is created for animate() is done per element, I\'m wondering if there is a way to create a single queue for all animations done with animate()?

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-21 03:14

    .animate() has a queue option that will only allow one effect per element:

    queue: A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately.

    Usage

    $('div').animate({ height: 50, queue: false });
    

提交回复
热议问题