Share Posted August 22, 2015 Hi, My first post here, I guess it's a real newbie one... I searched and couldn't find any post with this question, so I hope it's ok. What I try to do is to have a div expand from the bottom up, but I can only get it to expand from top to bottom. How can I reverse this? //Devotee007 CSS: .wrapper { position:absolute; top:40px; left:40px; width:430px; height:0px; z-index:1; background-color:#000; overflow:hidden; } TweenMax.to(".wrapper", 1.2, {height:"430px", ease:Expo.easeOut}); Link to comment Share on other sites More sharing options...
Share Posted August 22, 2015 Use a child element within the wrapper, absolutely positioned and bottom: 0; Then tween the height of the child; See the Pen EjBzwB by sgorneau (@sgorneau) on CodePen 4 Link to comment Share on other sites More sharing options...
Share Posted August 22, 2015 It sounds like you might want to animate a rectangular clipping path. I had actually been wondering how to do the same thing recently, and found a helpful example in another thread. I forked & updated it: See the Pen OVeeQa by ohem (@ohem) on CodePen Masking/clipping custom shapes across browsers is kind of a nightmare, but clipping rectangles is well supported. https://msdn.microsoft.com/en-us/library/ms530748(v=vs.85).aspx Apparently clip rect is deprecated though...(?) https://developer.mozilla.org/en-US/docs/Web/CSS/clip But clip path seems to work too: See the Pen rVEEKL by ohem (@ohem) on CodePen Any experts feel free to weigh in or correct me if there's anything wrong with my examples, I'm still new at this too. Link to comment Share on other sites More sharing options...
Author Share Posted August 24, 2015 @Shaun: Thanks a lot for the fast help, it works great! 1 Link to comment Share on other sites More sharing options...
Share Posted August 24, 2015 @Devotee007, glad to help! 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