I have some HTML/JavaScript that looks likes this:
<div id="columns-container">
<div class="reason-container" id="reason-x">
<div class="reason">
<div class="right-side"></div>
<div class="bottom-side"></div>
<div class="front-side"><div class="reason-text"></div></div>
</div>
</div>
</div>
<script type="text/javascript">
for(var i=0; i<5; i++){
$(".reason-container:first").clone().appendTo("#columns-container").attr('id', ("reason" + i));
}
</script>
It takes a set of divs I've created (right, bottom, front-side) to look like a column and clones them, giving them each a unique id (#reason0, #reason1, etc.)
In CSS, I'm trying to select all of the columns except the one being hovered over like so:
#reason0:hover ~ .reason-container:not(#reason0) {
display: none;
}
Where the first clone would be hovered over, and all other instances of this class (.reason-container) would be set to "display: none" however, this only selects the siblings after the one being targeted. Meaning that if #reason1 was used instead, reason#0 and the #reason-x would remain "display:block" while #reason2 - #reason4 would be "display: none" ... I can't figure out why this is, and any insight would be much appreciated. Thank you.