Jump to content

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

Transforming a rotated div issues

Go to solution Solved by Diaco,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi there. I'm trying to create a simple shooting star effect by scaling a rotated div.


First of all the div scales out as though the star is streaking across (which is correct), then the scale collapses changing it's transform origin. However, as you see in the codepen the div jumps around.


I'll probably make a work around and scale an image instead of a rotated div, but I thought I'd check to see if there was a way to do this utilizing only code.



TweenMax.set('#star', {rotation:-30});
TweenMax.from("#star", .5, {scaleX:0});
TweenMax.to("#star", .5, {scaleX:0, transformOrigin:"left", delay:.5});


<div id="star">


border-top:1px solid #fff;


See the Pen jbQRmV by anon (@anon) on CodePen

Link to comment
Share on other sites

Aw super boss answer - I had tried that but had the rotated div inside the non rotated div - opps! Thanks (sort of head::palm at the moment) ;)

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.