var path = location.pathname.substring(1);
if ( path )
$('#nav a[href$="' + path + '"]').attr('class', 'active');
If you want both the parent and child link highlighted, you can apply design customization to each of the parent links to add custom class and use the above script for the sub navigation highlight.
[quote]
I just use simple jquery code to achieve this:
var path = location.pathname.substring(1);
if ( path )
$('#nav a[href$="' + path + '"]').attr('class', 'active');
If you want both the parent and child link highlighted, you can apply design customization to each of the parent links to add custom class and use the above script for the sub navigation highlight.
This way is little ghetto but it works :D
[/quote]
Hmmmm.....I don't mind ghetto. However, I'm a little new to this whole Matrix CMS stuff. To make this happen, what do you have in your parse file?
I've seen a site that does what I want, http://www.aut.ac.nz/student-life, but I don't know what the code looks like behind it. And, so far, none
of the combinations I've tried using the menu system seem to work.
The script works by comparing the href of the links inside #nav (or any ID you specificied) against the URL path of the current page, and if they both match it adds the class attribute called active.
With a simple CSS you can give different style to the a.active link.
#nav a {color: #fff;}
#nav a.active {color: #000;}
Thanks tbaatar! I'll try this out this weekend. Does this mean that no one uses the built-in menu system? I would not think what I'm wanting to do is out of the ordinary.