Jump to content
Search Community

Scale property not acting on chrome as for ff/ie

lovezjk 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

Hi, i'm trying to scale an image from 50% 50% origin point (zooming effect) and fading it 3s after homepage is loaded, and chrome seems not working as others browsers.

 

http://easy-creation.com/charrette/

 

I also tried to set('.slide:first', {transformOrigin:"50% 50%"}) before (as chrome as not same defaults), but only vertical origin is taken in count.

 

Have an idea ?

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

What you could try is add the transformOrigin to the same config object that has the scale in it.

fx.to('.slide:first', 3, {scale:2, transformOrigin:"50% 50%", delay:3, ease:Power4.easeOut});

But it strikes me as unusual, due to the fact that by default the transform origin of any element is the center point.

 

Also please take a look at this post in order to see if you can create a reduced live sample with code we can easily test:

 

http://forums.greensock.com/topic/9002-read-this-first-how-to-create-a-codepen-demo/

 

Rodrigo.

Link to comment
Share on other sites

This is unrelated to GSAP - it's a difference in how the browsers are determining the width of the element you're scaling. For example, type this in the console:

$(".slide")[0].offsetWidth; //"0" in Chrome, "996" in Firefox

So if Chrome thinks it's 0 pixels wide, imagine where the origin would be. 50% of 0 is 0, so it'd be in the far left. 

 

You should be able to adjust your CSS so that the element has the proper width.

 

  • Like 4
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...