Jump to content
Search Community

Managing zIndex (rendering order) when morphing

BhanuSingh test
Moderator Tag

Recommended Posts

In this case I want blue circle to come on top of the orange square when the morphing has happened. This is a part of a bigger animation timeline which I am trying to create ?

 

How can I control rendering order, as I belive the first svg takes presidence when morphing to other shape ?

See the Pen df3b972a2673cd9e434a35b81966c5ef by krenovate (@krenovate) on CodePen

Link to comment
Share on other sites

There's no such thing as zIndex for SVG.  Things always render in the order they occur in the DOM, so you literally need to alter the DOM to make the stacking order different. Here's a demo where I flip the order mid-tween: 

See the Pen 346ac3b8c00eb64766dfc3d3336f5e63?editors=0010 by GreenSock (@GreenSock) on CodePen

 

Does that help? 

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