Skip to content

Instantly share code, notes, and snippets.

@joeldbirch
Created July 13, 2012 06:33
Show Gist options
  • Save joeldbirch/3103140 to your computer and use it in GitHub Desktop.
Save joeldbirch/3103140 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous renamed this gist Jul 13, 2012. 1 changed file with 0 additions and 0 deletions.
  2. @invalid-email-address Anonymous created this gist Jul 13, 2012.
    15 changes: 15 additions & 0 deletions Superfish pathClass support
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    $(document).ready(function(){

    //this will be used more than once so save it to a variable
    var menu = $('ul.sf-menu')

    //given that you already seem to have the current page marked with 'current' on the relevant li,
    //find that li, then find any ancestors of it and add 'current' to them also
    menu.find('.current').parents('li').addClass('current');

    //once you have done that, then initialise Superfish
    menu.superfish({
    pathClass: 'current'
    });

    });