I have this situation:
The transition on entering
is, after 1sec delay, then fade-in to 100% opacity:
transition: opacity 1s ease 1s;
The transition on leaving
is, within 1sec fade out to 0% opacity:
transition: opacity 1s;
The .leaving
element is removed after 1second. After it is removed I want position:static
on the .entering
So in other words: "when .entering is not followed by .leaving, apply position:static" and "when .entering is followed by .leaving it should be position:absolute"
I'm trying this
.entering {
position: absolute;
}
.entering:not(+ .leaving) {
position: static;
}
However its not working. Any ideas?
Let's do this example in a simplified case, with background colors. If .entering
is followed by .leaving
, it's background color should be red. If .entering
is followed by non-.leaving
(or followed by nothing), its background color should be green.
For instance:
and when not followed by leaving:
I tried this color case here in this fiddle - https://jsfiddle.net/Noitidart/7utx2uwc/
<style>
.entering {
background-color:red;
}
.entering:not(.entering + .leaving) {
background-color:green;
}
</style>
<div class="entering">entering</div>
<div class="leaving">leaving</div>