Share Posted March 23, 2020 I can use the variable "scale" to scale the schematic and it works great. Can I use a variable for transformOrigin? gsap.to(schematic, .5, {scaleX:scale, scaleY:scale, transformOrigin: "0% 0%"}); The end goal is to have the schematic to scale from the mouse position. Schematic is an SVG. Thanks. Link to comment Share on other sites More sharing options...
Author Share Posted March 23, 2020 Roll mouse wheel to zoom. See the Pen GRJXwMw?editors=1010 by RobertMay (@RobertMay) on CodePen Link to comment Share on other sites More sharing options...
Share Posted March 23, 2020 Hey @Robert May, this example could be helpful - its still gsap 2.0 See the Pen ZwmdYv by mikeK (@mikeK) on CodePen Happy tweening ... Mikel 7 Link to comment Share on other sites More sharing options...
Author Share Posted March 23, 2020 7 minutes ago, mikel said: Hey @Robert May, this example could be helpful - its still gsap 2.0 Happy tweening ... Mikel Awesome mikel, works like a champ! Thank you. 2 Link to comment Share on other sites More sharing options...
Share Posted March 23, 2020 Here is a similar one to the above which may also assist you, using click instead of scroll. See the Pen df06754f4736f45005fe693f3113049b by osublake (@osublake) on CodePen It was discussed in the following thread (also a mouse wheel one). Below are a few other related pens which you might also find useful to look through. See the Pen dXoLEJ by sdras (@sdras) on CodePen See the Pen OMabPa by PointC (@PointC) on CodePen See the Pen oGoyYb by osublake (@osublake) on CodePen ¯\_(ツ)_/¯ 6 Link to comment Share on other sites More sharing options...
Author Share Posted March 23, 2020 6 minutes ago, Shrug ¯\_(ツ)_/¯ said: Here is a similar one to the above which may also assist you, using click instead of scroll. Those are cool, I can probably use something from them. 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