i am trying to remove the background images from the <a>before and after a.current
So in the example below “the herbs” link wouldn’t have one and neither would “fees”.
<ul>
<li class="home"><a href="#">Home</a></li>
<li class="history"><a href="#">History</a></li>
<li class="the-herbs"><a href="#">The Herbs</a></li>
<li class="blog current"><a class="current" href="#">Blog</a></li>
<li class="fees"><a href="#">Fees</a></li>
<li class="contact"><a href="#">Contact</a></li>
</ul>
I’ve been trying to use jquery next and previous but not quite getting it…
$(document).ready(function() {
$('li.current a').parent.prev().css('background', 'none');
});
Any help would be greatly appreciated.
Firstly, I think that there is no ‘parent’ property on a jQuery object, there is function ‘parent()’ though. Also, you need to remove background from ‘a’, not from ‘li’, so it should be: