Return to Snippet

Revision: 48789
at July 9, 2011 01:23 by iammikecohen

Initial Code
<script type="text/javascript">
            $(".sf-menu li").children("a").each(function() {
                if(window.location.href == $(this).attr('href')){
                        var topLink = $(this).parents('.main_link');

Initial URL

Initial Description
look through the list items in your main nav and based on href of anchor tags this will set the top level link to have an 'active' class.

Initial Title
Set links with href to current page as active (or if in subnav set their parent to active)

Initial Tags
css, javascript, navigation, jquery

Initial Language