I have this code: http://codepen.io/hwg/pen/azZoyp
What I am attempting to do is to apply the blur effect (SVG filter for compatibility) to the other elements on hover of another.
The most important bit of the CSS is as follows
.oi:hover ~ a {color:green;filter: url('#blur');}
This uses the ~
selector in order to effect the siblings of the Link with class of oi
. This is fine, but it only affects the elements after the hovered one. Not all of the siblings in the container div.
Is this possible just in CSS?
I've seen that you can use JS as seen here: Using jQuery to Hover over one element and apply the effect in another, and in other questions.
I'd just like to not use JS if possible, would appeciate any help!
Thanks!
Code Embedded:
.btn {
background:lightblue;
padding:1em;
font-family:sans-serif;
margin:0.4em;
display:inline-block;
transition:0.25s all ease-in-out;
border-radius: 5px;
}
.oi ~ a {color:red;}
.oi:hover ~ a {color:green;filter: url('#blur');}
.oi:hover {transform: scale(1.5,1.5);color:red;}
div {margin: 100px auto;display:block;width:100%;}
<div>
<a class="btn">Cholla</a>
<a class="btn">Cholla</a>
<a class="btn oi">Cholla</a>
<a class="btn">Cholla</a>
<a class="btn">Cholla</a>
<a class="btn">Cholla</a>
</div>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs>
<filter id="blur">
<feGaussianBlur stdDeviation="5" />
</filter>
</defs>
</svg>