Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

GreenSock Docs

toArray()

Returns : Array

Converts selector text, an array, a NodeList, an object, or almost any array-like object (like a jQuery result) into an array.


Converts selector text, an array, a NodeList, an object, or almost any array-like object (like a jQuery result) into an array.

  1. var targets = gsap.utils.toArray(".class");
  2. var targets = gsap.utils.toArray(myElement);
  3. var targets = gsap.utils.toArray($(".class"));
  4. console.log(targets.isArray()) // true
Copyright 2017, GreenSock. All rights reserved. This work is subject to theterms of useor for Club GreenSock members, the software agreement that was issued with the membership.
×