Jump to content
Search Community

Variable as Transform Origin

Robert May test
Moderator Tag

Recommended Posts

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

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

 

¯\_(ツ)_/¯

  • Like 6
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...