Jump to content
Search Community

backfaceVisibility not working

rlaurencelle 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 having trouble trying to hide the backface of a 3D rotating div that contains text.  I'm actually rotating a container div that contains a div with an SVG graphic and a div with text. The text backface is not hiding when the div rotates. Here is the abridged code:

 

<div id="Q1">
<div id="Q1img"><img src="images/Q1.svg" alt=""/></div>
<div id="Q1outerText">Stages of Change</div>
</div>

 

 

var $Q1 = $("#Q1"),
    $Q1outerText = $("#Q1outerText"),
tl;

tl = new TimelineMax();

tl.set($Q1outerText, {backfaceVisibility:"hidden",transformStyle: "preserve-3d"})
   .to($Q1, 2, {transformOrigin:"right top", rotationY:135, delay:2, transformStyle: "preserve-3d", zIndex:10, ease:Power1.easeOut});

Link to comment
Share on other sites

Hi rlaurencelle :)

 

Welcome to the GreenSock forum and thank you for joining Club GreenSock.

 

I'm certain we can get you fixed up, but could you make a CodePen demo for us please? It's much easier to troubleshoot with editable code. Here's some info about that. 

 

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

 

Once we have that, we should be able to pinpoint the problem. Jonathan is our resident wizard with anything browser related as well as rotating divs.

 

Happy tweening and welcome aboard.

:)

  • Like 2
Link to comment
Share on other sites

Hello rlaurencelle,

 

Welcome to the forums!

 

Your issue is because you are setting the backface-visibility in one element and rotating another one.

 

I've forked your example and stripped down a bit further for simplicity.  Let me know if this helps you: 

See the Pen MpKLvV by dipscom (@dipscom) on CodePen

 

Also, here are two articles talking about the backface-visibility and animations - They are not GSAP related but will help you:

 

https://designmodo.com/backface-visibility-css-animation/

 

https://tympanus.net/codrops/css_reference/backface-visibility/

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