# Bottle rotation effect

Go to solution Solved by Carl,

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

Hey, there!
I'm quite a newbie with GSAP and it seems that all I'm making is a chaos in code.
My goal is to create rotation effect of bottle, so I need to "rotate" the text which goes up and appears from bottom each time the button is pressed. Where to start digging?

upd

And why does the text invisible on start?

See the Pen JXqroG by NeedHate (@NeedHate) on CodePen

• 1
##### Share on other sites

• Solution

Hi,

Thanks for the demo. You are doing a fine job.

This is a bit of a tricky situation since you have 2 fromTo() tweens that are fighting to set the from position at the same time.

Solution is to put immediateRender:false on the second tween

tl.fromTo(element, 0.75, {y: 0,rotationX: 0, scale: 1}, {y: -200,rotationX: -90, scale: .75, ease:Expo.easeOut})
.fromTo(element, 0.75, {y: 200,rotationX: 90, scale: .75}, {y: 0,rotationX: 0, scale: 1, ease:Expo.easeOut, immediateRender:false});

And once that is in place, the first tween can just be a to() tween

```var tl = new TimelineMax({paused: true});

tl.to(element, 0.75,  {y: -200,rotationX: -90, scale: .75, ease:Expo.easeOut})
.fromTo(element, 0.75, {y: 200,rotationX: 90, scale: .75}, {y: 0,rotationX: 0, scale: 1, ease:Expo.easeOut, immediateRender:false});```

ImmediateRender Demystified

lastly, reversed isn't a valid property to go in the TimelineLite constructor

```//bad
var tl = new TimelineLite({reversed:true});

//good
var tl = new TimelineLite({});

tl.to(element, 1, {...})

tl.reverse()
//or
tl.reversed(true);
```
In your demo I don't think you need to have it reversed at the beginning, but just wanted to point it out.
• 2
##### Share on other sites

Carl, I highly appreciate the quick solutions that you guys provide here on site. Thanks alot for help!

• 1

No problem