Share Posted December 9, 2013 Why can't I tween a simple div? In my javascript the following works so I KNOW I have a proper refrence to my div infoDiv.style.visibility="hidden"; but this doesn't(no errors, just fails!!) TweenLite.to( infoDiv,1,{alpha:0}); The div has absolute positioning applied but obviously this is not the value I am changing. I am also using TweenLite elsewhere in the same javascript file so I know I am referencing it properly. Link to comment Share on other sites More sharing options...
Share Posted December 9, 2013 Hello, here is working codepen example of your code above: See the Pen folIH by jonathan (@jonathan) on CodePen In order to animate CSS properties you will need to include the CSSPLUGIN; http://api.greensock.com/js/com/greensock/plugins/CSSPlugin.html With the help of the CSSPlugin, GSAP can animate almost any css-related property of DOM elements including the obvious things like width, height, margin, padding, top, left, and more plus more interesting things like transforms (rotation, scaleX, scaleY, skewX, skewY, x, y, rotationX, and rotationY), colors, opacity, and lots more. Don't forget to load the CSSPlugin to enable these capabilities. or you can use TweenMax which includes CSSPLUGIN and other goodies all in one. does that help? 1 Link to comment Share on other sites More sharing options...
Author Share Posted December 11, 2013 Thanks 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