Share Posted August 10, 2013 what is faster.. using jQuery css() method or GSAP set() method. for example: // GSAP way TweenMax.set($image, {'opacity':1}); // or jQuery way $image.css('opacity',1); I was wondering which is faster or better to use? Should i only use set() for the properties that will be animated? Im used to setting css properties via jQuery css() method .. but wanted to know if the GSAP set() method is faster or more efficient? Any help will be highly appreciated? Link to comment Share on other sites More sharing options...
Share Posted August 10, 2013 Using set() gives you more flexibility and access to more properties. For instance TweenLite makes it very easy to set a bunch of properties that jQuery doesn't support rotation, rotationX, skewX, scale, scaleX, autoAlpha etc. I would think a case where you would be able to discern a difference in speed would be quite rare. However if you create some tests and find some notable differences please let us know. 1 Link to comment Share on other sites More sharing options...
Author Share Posted August 10, 2013 Will do, thanks Carl! I had one more question regarding setting css properties regarding opacity.. When using TweenMax.. is it best to set css opacity or autoAlpha? thanks again for the help!! 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