Jump to content
Search Community

force3D true by default

carnophage test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi and welcome to the GreenSock forums.

 

I believe that the force3D variable works for the tween target.

 

What you could do is create a function that traverses over the elements you indicate (here you can use jQuery selectors and $.each) and use a set() instance to add pass the force3D to the element.

//select all the elements with the given classes into one jQuery object
var elements = $(".a, .b, .c");

$.each(elements, function(i,e)
{
  TweenLite.set(e,{force3D:true});
});

Rodrigo.

  • Like 1
Link to comment
Share on other sites

You don't even have to loop through things - TweenLite and TweenMax can handle targets that are arrays or jQuery objects containing lots of elements. So it can be as simple as:

TweenLite.set(".a, .b, .c", {force3D:true});

Remember, if you pass in a string as the target, it will pass that along to the default selector (which would be jQuery if you have that loaded). 

  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...