Aron H Posted May 6 Share Posted May 6 I am wanting to make an image viewer where I can drag an image positioned absolutely within a square container to view more of the image. I got it working if I set the image height to 'auto'. However, I want to use 'height: 100%' and 'object-fit: cover' on the image so I can maximize how much is viewed at one time. Since width and height are both set to 100%, no drag events ever fire. How can I animate the 'object-position' css property instead of the image x & y coordinates? See the Pen YzMmMqE by Aron-Hawkins (@Aron-Hawkins) on CodePen Link to comment Share on other sites More sharing options...
Rodrigo Posted May 6 Share Posted May 6 Hi @Aron H and welcome to the GSAP Forums! I'm not sure I understand what you're trying to do here, maybe something like this: See the Pen LYdRQra by GreenSock (@GreenSock) on CodePen Hopefully this helps, if not please provide a clear description of what you're trying to do so we can get a better idea. Happy Tweening! 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