Jquery: Active menu not working ##!!# :-)
Hi, I would appreciate it if someone could help me with this problem, as I have been banging my head on the desk for quite a few hours now.
I need to highlight an active menu item, however, I cannot get it to work. Here is my code:
Menu (Sample) within a Dreamwaver Template
<ul id="navright">
<li><a href="../why_crest.html" title="Why use CREST">Why use CREST</a></li>
<li><a href="../support_industry.html" title="Support To Industry">Support To Industry</a></li>
</ul>
Jquery
<script type="text/javascript">
$(function(){
var path = location.pathname.substring(1);
if ( path )
$('#navright a[href$="' + path + '"]').addClass('activepage');
});
</script>
CSS
.activepage {
color: #F00;
}
Please help, if you can. Thank you. Steven