maths Posted August 13, 2023 Share Posted August 13, 2023 Hi, How can i animate the image to the top of the viewport when clicking it? As it is now it almost does what i want, but quite buggy. What am i doing wrong here? I want the image to animate to the top of the viewport as well as resize (see the css class), but smooth. Same when closing it, by clicking. (For some reason the Codepen only works when in inkognito mode, at least for me) See the Pen BaGXKxM by frilansmagi (@frilansmagi) on CodePen Link to comment Share on other sites More sharing options...
Solution alig01 Posted August 13, 2023 Solution Share Posted August 13, 2023 Hey, you were almost there. See the Pen YzRmWQB?editors=0010 by alig01 (@alig01) on CodePen There is also an advanced example in the documentation, that takes a different approach: See the Pen JjXqMZK by GreenSock (@GreenSock) on CodePen Hope this helps and good luck with you project. 2 Link to comment Share on other sites More sharing options...
maths Posted August 13, 2023 Author Share Posted August 13, 2023 Nice. Did not know about scale in this context. 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