Just to set the scene, I'm inexperienced when it comes to jQuery (but not web design) so I'll appreciate some assistance here!
Basically, I'm trying to get the hover states on my navigation bar to fade in (on the hover) and fade out (on the mouse off). It's a simple navigation bar, no images, just pseudo selectors doubled up as classes so that jQuery can actually pick up the CSS okay.
I've tried a number of scripts but I can't seem to find what I'm looking for. The code is simple, the solution is simple yet I'm having absolutely no luck so here we go.
HTML:
<ul>
<li><a class = "tab selected" href = "index.html">home</a></li>
<li><a class = "tab" href = "portfolio.html">portfolio</a></li>
<li><a class = "tab" href = "index.html">contact</a></li>
</ul>
CSS:
nav ul li a.tab {
display: inline-block;
padding: 15px 20px;
min-width: 40px;
}
nav ul li a.tab:link, nav ul li a.tab.link {
padding: 15px 20px;
color: #656359;
text-align: center;
}
nav ul li a.tab:visited, nav ul li a.tab.visited { color: #656359; }
nav ul li a.tab:hover, nav ul li a.tab.hover {
padding: 15px 20px;
background-color: #d5d1bc;
}
nav ul li a.tab:active, nav ul li a.tab.active { color: #901f78; }
jQuery:
$('.tab.hover').hover(
function(){
$(this).fadeIn();
},
function(){
$(this).fadeOut();
}
);
I've attempted to use the mouseover/mouseout functions as well but no luck. I'm just getting no change at all in browser. My jQuery file is hooked up properly as well.
It's an unoriginal post but after 2 days of research, I'm out of ideas so thanks in advance!