@alexander works like a charm!
I am now searching for a way to not transition the order, but to delay the z-index change so that it looks more natural. The stack order should change after the move has begun.
It appears that CSS cannot handle this since this is not a transition. However if I do use the transition, it could perhaps use a transition-delay
with steps or something. I’ll play a bit more with this.
Or perhaps there is another way. Many years ago I got it working here on The Grid Slider, using this:
opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
I think I was modifying one of their premium sliders.
I saw the custom properties in the document and can’t wait to start playing with them!
Thanks!
EDIT: I managed to grab the full CSS from that slider:
Full CSS
*/.slider-3d .tg-grid-slider {
overflow: visible!important;
}
.slider-3d.tg-grid-loaded .tg-active-item {
z-index: 3;
}
.slider-3d.tg-grid-loaded .tg-item-inner {
-webkit-transition: opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;
-moz-transition: opacity 0.3s ease-in-out, -moz-transform 0.3s ease-in-out;
-ms-transition: opacity 0.3s ease-in-out, -ms-transform 0.3s ease-in-out;
-o-transition: opacity 0.3s ease-in-out, -o-transform 0.3s ease-in-out;
transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}
.slider-3d.tg-grid-loaded .tg-item-inner {
opacity: 1;
}
.slider-3d.tg-grid-loaded .tg-active-item .tg-item-inner {
opacity: 1;
-webkit-transform: scale3d(1.15,1.15,1.15);
-moz-transform: scale3d(1.15,1.15,1.15);
-ms-transform: scale3d(1.15,1.15,1.15);
-o-transform: scale3d(1.15,1.15,1.15);
transform: scale3d(1.15,1.15,1.15);
//-webkit-box-shadow: 0 0 100px rgba(0,0,0,0.25);
//-moz-box-shadow: 0 0 100px rgba(0,0,0,0.25);
//box-shadow: 0 0 100px rgba(0,0,0,0.25);
}
@media only screen and (max-width: 480px) {
.slider-3d .tg-grid-area-top1 *,
.slider-3d .tg-grid-area-top2 *,
.slider-3d .tg-grid-area-bottom1 * {
display: none;
}
.slider-3d.tg-grid-loaded .tg-item-inner {
opacity: 1;
}
.slider-3d.tg-grid-loaded .tg-active-item .tg-item-inner {
-webkit-transform: none;
-moz-transform: none;
-ms-transform: none;
-o-transform: none;
transform: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
}*/
.slider-3d.tg-grid-loaded .tg-item-inner:not(.tg-active-item) {
height:80%!important;
margin-top:10%!important;
}