I am currently making a menu and because the menu is an oddshape with a glow around the edge I need to put a blank block over the top to hide the unwanted glow on the overlap. I am creating this using the :after selector on the li tags for the menu and the code to do so works fine.
My problem however is that I can only make it apply to none or all of the menu items at once by toggling the display attribute, what I want however is for the :after selector to only be applied to the current list item.
Each list item has a unique id but I can't seem to work out how to use the :after selector on a specific list item within jquery.
Thanks in advance for any help. Sorry if this is unclear.
HTML Code
<ul id="menu">
<li id="0">link 1</li>
<li id="1">link 2</li>
<li id="2">link 3</li>
</ul>
CSS for the list item
#menu li{
float:left;
margin:0 20px 0 0;
height:87px;
z-index:1;
position:relative;
background: #f8f8f8;
cursor:pointer;
border:1px solid #CCC;
border-bottom:none;
}
#menu li:after{
display:none;
content: '';
position: absolute;
top: 0;
bottom: -5px;
left: 0;
width: 291px;
height:10px;
margin-top:109px;
background: #f8f8f8;
}
I thought it would be as simple as putting something like
$$('li[id="0"]:after').show();
or maybe
$$('li[id="1"]:after').css("display" : "block");
but these does not work.