开发者

jQuery SIMULTANEOUSLY animate all objects in an array

开发者 https://www.devze.com 2023-01-19 16:16 出处:网络
I am writing a script that does animations on a web-page. In the process I need to add several elements to an array, and then simultaneously animate them.

I am writing a script that does animations on a web-page. In the process I need to add several elements to an array, and then simultaneously animate them.

Is it possible to use jQuery to SIMULTANEOUSLY animate all objects in an a开发者_运维问答rray? Or maybe there's a better method for that?

Thanx


$.each(ARRAY, function(index, value) { 
  // do amazing things such as:
  $(this).hide(200);
});


If you have several DOM elements in an array, all you need to do is slip them into a jQuery object, and do your animation.

$( arrayOfElements ).fadeOut();
0

精彩评论

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