Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Robert May

Variable as Transform Origin

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.

Share this post


Link to post
Share on other sites

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

 

  • Like 7

Share this post


Link to post
Share on other sites
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.

  • Like 2

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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.

×