I have a problem. Everytime I mouseover my list (doesn't matter which list item it is) the class .hover is added across the whole list. So is class .over. I realize I am adding those through jquery but how can have jquery only addclass to one list anchor only rather than all of them across the board.
$('.menuContainer li a').append('<span></span>');
$(".menuContainer li a").mouseover(
function() {
$(this).addClass("over");
$('.menuContainer li a span').addClass('hover');
return false;
});
$(".menuContainer li a").mouseout(
function() {
$(this).removeClass("over");
$('.menuContainer li a span').removeClass('hover');
return false;
});
<div class="menuContainer">
<ul>
<li class="1">
<a href="#">list item<span></span></a>
</li>
<li class="2">
<a href="#">list item<span></span></a>
</li>
<li class="3">
<a href="#">list item<span></span></a>
</li>
</ul>
</div>
My goal is to have the class .hover with a background image that will be a pointer to emphasize what is currently being moused over.