I have a menu with each item having the following sturcture
<li>
<a href="#">Menu item</a>
<span></span>
</li>
When someone hovers over the link the background changes colour and the same happens with the span.
What I want to happen is when someone hovers over the span it also simulates the css hover rules for the sibling a tag.
I can target the anchor element with the following, I tried using the mouseenter function but this hasn't given me the hoped for effect.
$('#menu li span').mouseover(function() {
$(this).siblings('a').mouseenter();
});
How can I get this working?
Thanks
.trigger(). But I have to ask, why isn't this something you'd be accomplishing with a simple CSS rule?li:hover a { new styles here }JS seems like overkill to me.