if($('.navigation ul li ul').children().length === 1) {
$('.navigation ul li ul li a').css({opacity:0.5});
}
else {
$('.navigation ul li ul li:first-child a').addClass('first');
$('.navigation ul li ul li:last-child a').addClass('last');
}
Basically I want it so if the navigation has one <li> for it to do something else than if it has more than 1 <li> in the unordered list.
SAMPLE HTML:
<nav id="nav" class="navigation"><!--Start Navigation-->
<ul>
<li><a href="#">Sample Linkk</a>
<ul>
<li><a href="#">1 DropDown Item</a></li>
</ul>
</li>
<li><a href="#">Sample Link 2</a>
<ul>
<li><a href="#">2 DropDown Items</a></li>
<li><a href="#">2 DropDown Items</a></li>
</ul>
</li>
</ul>
</nav>
Not tested it but I think it will work