Jump to content
Search Community

transformOrigin: "50% 50%" Not applying

Metlock test
Moderator Tag

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

I'm fairly new to development and Javascript in general I can't get transformOrigin: "50% 50%" to work no matter what I try. I've read every post on the matter it just won't work for me in my setup. Any help appreciated! - John

 

document.getElementById("cpuLoose").addEventListener("click", function(){
    
var plAttackAnim  = new TimelineMax({ repeat: 0, repeatDelay: 0.5, yoyo: false })
    .set(".card2", {transformOrigin: "50% 50%"})
    .to(card1, 2, { pixi: {x: 400, y: 150, scale: 0.5,}, ease: Power4.easeInOut }, 0)
    .call(PlayHitSound)
    .to(vs,    2, { pixi: {alpha: 0, }, ease: Power4.easeInOut }, 0.0)
    .to(card2, 2, { pixi: {x: 1500, y: 150, scale: 0.2,},rotation:'+=360',transformOrigin:'center',ease:Power3.easeInOut }, 2.0)
    .to(card1, 2, { pixi: {x: 450, y: 150, scale: 0.5,}, ease: Power4.easeInOut }, 2.3)
    .to(card1, 2, { pixi: {x: 400, y: 120, scale: 0.6,}, ease: Power4.easeInOut }, 2.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...