While browsing the web, I came across a fascinating hover effect that I'm eager to replicate in a website's navigation bar. This effect doesn't just change the link you hover over, but it alters every other link in a unique way. When hovering over a link, all other links in the menu list fade in opacity, leaving the hovered link at full opacity.
I've tried implementing some CSS solutions like the following:
.menu-link:a + .menu-link {opacity: 0.7;}
However, this only affected the link next to the one being hovered over, not all links with the same class. I suspect this kind of effect requires JavaScript, but I'm a beginner and struggling to figure it out.
Can anyone assist me in creating a function using jQuery or JavaScript that detects a hover on an object with a specific class and applies an effect (like lowering opacity) to all other objects with the same class? I appreciate any guidance!
Edit: In response to a request for code, here is a snippet of the menu links I'm working on, displayed as unordered lists within a header section:
<div class="col-lg-2 col-md-2 menu-border">
<div class="menu-list">
<h4 class="list-title">Blog</h4>
<ul>
<li><a class="menu-link" href="#">Archive</a></li>
<li><a class="menu-link" href="#">Search</a></li>
<li><a class="menu-link" href="#">Tag Cloud</a></li>
</ul>
</div>
</div>
<div class="col-lg-2 col-md-2 menu-border">
<div class="menu-list">
<h4 class="list-title">Profile</h4>
<ul>
<li><a class="menu-link" href="#">Artist Profiles</a></li>
<li><a class="menu-link" href="#">Submit A Profile</a></li>
</ul>
</div>
</div>
<div class="col-lg-2 col-md-2 menu-border">
<div class="menu-list">
<h4 class="list-title">Connect</h4>
<ul>
<li><a class="menu-link" href="#">SoundCloud</a></li>
<li><a class="menu-link" href="#">linkedIN</a></li>
</ul>
</div>
</div>
Each sub-menu link has been assigned the "menu-link" class, and I'm seeking assistance on creating a function that will apply a specific effect (such as fading to a lower opacity) to all other links with this class when hovering over one of them.