Jump to content
Search Community

CSS Syntax GSAp

celli 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

I think I read the docs right, but still can't seem to get margin-top, padding-left, margin-left properties to work. I might not be displaying the properties correctly, because some get the camelCase and other one get quotes like "width", I think! But I am obviously missing something.  Is this the right syntax:

TweenMax.set(".myClass", {css:{width:"140px", marginTop:5, paddingLeft:8, marginLeft:130, float:"left"}});
	TweenMax.set(".myOtherClass", {css:{width:"180px"}});
	TweenMax.set("#someOtherId", {css:{display:"block", marginLeft:11, marginTop:15}});
Link to comment
Share on other sites

Camelcase should work for all your CSS properties, unless its something like an experimental vendor-prefixed property. And you don't need to specify "px" as that's implicit. Can you show a demo of this not working?

TweenMax.set(".myClass", {css:{width:140, marginTop:5, paddingLeft:8, marginLeft:130, float:"left"}});
  • Like 5
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...