Jump to content
Search Community

Animating with "from" causes div to switch behind its :after element

mlikaon test
Moderator Tag

Go to solution Solved by nico fonseca,

Recommended Posts

Hi there !

 

I'm testing out different border animation cases, and I just figured out a strange behaviour I can't get rid of.

Without animation, my main #box is in foreground, and its child element :after is behind thanks to the z-index set to -1 (that's all the trick in this border animation technique)

But at the moment I add a gsap.from() to my #box, it gets behind the :after element.

 

Is there something I'm doing wrong, do you know any workaround ?

 

Edit : same behaviour occurs with gsap.to(). It seems that the transform: translate(0px) gsap adds to style is part of the issue.

 

Thank you in advance !

See the Pen xxdogxm by florian-trang (@florian-trang) on CodePen

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...