Hi all, I'm trying to write up a script that will allow me to change the css of the previous li on hover.
Here's the structure:
<ul id="mainlevel">
<li><a href="/" class="mainlevel" id="active_menu">Home</a></li>
<li><a href="/" class="mainlevel">About Us</a></li>
<li><a href="/" class="mainlevel">Products</a></li>
<li><a href="/" class="mainlevel">Projects</a></li>
<li><a href="/" class="mainlevel">Suppliers</a></li>
</ul>
Here's what I have so far:
jQuery("#mainlevel li a").hover(function() {
jQuery(this).prev("li a").css("background", "#f0f");
});
But it's not working.. Any help would be appreciated :)