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
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×