Jump to content
Search Community

FLIP Growing grid elements is causing a weird jump.

ddi-web-team test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hi all

 

I'm trying to create a 2x2 grid of divs. When a div is clicked it will fill up the entire container of divs and reveal some content. I have this working using the FLIP plugin, but I'm noticing a weird jump when downsizing every box with the last one being an exception. For some reason, the last one (the orange box) grows and shrinks as intended. 

I'm achieving this by using unset on the class that is being applied to the box that is full screen. 

.fullScreened{
  position:absolute;
  top:0;
  bottom:0;
  right:0;
  left:0;
  z-index: 10;
  grid-column-start:unset !important;
  grid-column-end:unset !important;
  grid-row-start:unset !important;
  grid-row-end:unset !important;
}

Which feels kind of hacky but I'm not sure of another solution. 

See the Pen 1130deaaea42cee23356c3a6e1441f3c?editors=1010 by DDI-Web-Team (@DDI-Web-Team) on CodePen

Link to comment
Share on other sites

  • Solution

I think that's just a z-index thing, right? Totally unrelated to Flip/GSAP. In other words, you've got the "fullScreened" element with z-index: 10 but as soon as you flip it back, it has the same z-index as all the other elements, thus their native stacking order takes over and the ones on top obscure the ones below. 

 

Is this what you're looking for?:

See the Pen 9f3eceb5fb98230d32fdd982ad695932?editors=0010 by GreenSock (@GreenSock) on CodePen

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