I can't figure out how to use jQuery to style the current nav item. I've tried several tutorials and such to no avail. Any help would be appreciated. Thanks in advance.
<div id="menu">
<ul id="nav">
<li><a href="http://poolguys.jaredmc.com/index.php">Contact</a></li>
<li><a href="http://poolguys.jaredmc.com/index.php">Gallery</a></li>
<li><a href="http://poolguys.jaredmc.com/pool_liners.php">Pool Liners</a></li>
<li><a href="http://poolguys.jaredmc.com/services.php">Services</a></li>
<li><a href="http://poolguys.jaredmc.com/about.php">About</a></li>
<li><a href="http://poolguys.jaredmc.com/index.php">Home</a></li>
</ul><!--end nav-->
</div><!--end menu-->
/** nav styling **/
//<![CDATA[
jQuery(function() {
jQuery('#nav li').each(function() {
var href = jQuery(this).find('a').attr('href');
if (href === window.location.pathname) {
jQuery(this).addClass('current');
}
});
});
//]]>