Share Posted December 4, 2015 I'm trying to create an infographic using scrollmagic/greensock, where I have everything in layers, and each layer tweens down to nothing as you scroll down, so whatever is beneath it is revealed on scroll. I already tried using svgs and clippaths, which was a nightmare since I'm new to them and scrollmagic both. So I decided to use css border-radius. My problem right now is that I'm trying to scale these down and nothing seems to be happening. If I look in my console I will see the styles scaleX: 0 and scaleY: 0 have been applied but the image will still be the same width and height. It doesn't move at all. See the Pen BoXOMJ by kathryncrawford (@kathryncrawford) on CodePen Link to comment Share on other sites More sharing options...
Share Posted December 4, 2015 Hello kathryn.crawford, You really love Bill Murray It looks like you were using the AttrPlugin since you had your CSS properties wrapped in the attr:{} object See the Pen mVdwpz by jonathan (@jonathan) on CodePen So convert this: tl.to("#scroll-img1", 1, {attr:{scaleX: 0, scaleY: 0, transformOrigin: "50% 50%"}}); to this without the attr:{} object: tl.to("#scroll-img1", 1, {scaleX: 0, scaleY: 0, transformOrigin: "50% 50%"}); Also if you want the image to keep it's border-radius then you will need to add the border-radius to your <img> tag as well .scroll-container > img{ border-radius: 50%; } Does that help? 5 Link to comment Share on other sites More sharing options...
Author Share Posted December 4, 2015 @jonathan, he is the best! Thanks for your 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