Share Posted May 13, 2015 The docs show that the first argument to the methods .to, .from, .staggerTo, .staggerFrom and staggerFromTo is an Object: target : Object Target object (or array of objects) whose properties the tween affects This blog post, however, notes that is can also be a string representing a selector: as of version 1.13.1, GSAP uses that as a fallback (after attempting to detect a selector engine like jQuery). That means that you can do something like this, for example: TweenLite.to("li:first-child, li:last-child", 1, {opacity:0.5}); Can the docs please be updated to reflect that this argument can also be a selector string? Cheers! -Skye 1 Link to comment Share on other sites More sharing options...
Share Posted May 15, 2015 Valid point. I've updated the docs so that target parameters of tweens read: target : ObjectTarget object (or array of objects) whose properties should be affected. When animating DOM elements, the target can be: a single element, an array of elements, a jQuery object (or similar), or a CSS selector string like “#feature” or “h2.author”. GSAP will pass selector strings to a selector engine like jQuery or Sizzle (if one is detected or defined through TweenLite.selector), falling back to document.querySelectorAll(). http://greensock.com/docs/#/HTML5/GSAP/TweenLite/to/ Thanks for the suggestion. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now