I'm trying to select everything but the thing I'm currently clicking on.
Basically, I have a bunch of .node-teaser
elements that are all styled the same way and have the same classes, only they get bigger on :active
.
When I'm clicking on one, I want to "reset" all other animations/transitions, so that ONLY the current one gets bigger. So, basically, I'd like to:
.node-teaser:not(.node-teaser:active) {
max-height: 50px;
.....
}
However, I can't use pseudo classes as arguments for :not()
. How do I solve the issue on a different way, or, am I missing something?
I'm stuck with the classes I have since they're generated by Drupal and I don't really want to get into changing my PHP templates for the theme. And, I want to prove that this works with pure CSS to myself, but I'm stuck.
There is this ~
selector. If there was something to select every element BEFORE the current element (opposite of the tilde selector which selects everything after the element), I could basically add those two up and I'd have everything before and everything after = everything but the current one. I don't think there is a selector that does the opposite of ~
though. Please correct me if I'm wrong!
EDIT: Since I seem to be quite confusing ^.^ (Sorry for that): on adornis.de I want only ONE item at a time to be expanded, when you click on the second one, the rest should close. Usually :active closes instantly anyways, but I'm delaying the transition.