• Hi everyone.

    In one of my sites I wanted to use a superfish nav-bar menu. Basically it worked but a submenu was always hidden. I tried this manually and using all plugins I found. I spent 3 nights reading hundreds of forums, manipulating hardly with codes – nothing helped.

    Until I’ve found this site.

    Just put this code:

    jQuery(document).ready(function(){
    var str=location.href.toLowerCase();
    jQuery('.sf-menu li a').each(function() {
    if (str.indexOf(this.href.toLowerCase()) > -1) {
    jQuery("li.current").removeClass("current");
    jQuery(this).parent().addClass("current");
    }
    });
    jQuery('li.current').parents().each(function(){
    if (jQuery(this).is('li')){
    jQuery(this).addClass("current");
    }
    
    });
    })

    before starting the superfish:

    jQuery(document).ready(function(){
    jQuery("ul.sf-menu").superfish({
    pathClass: 'current'
    });
    });

    And it works like a charm!

    I use this in wp 3.5.1 and a Twenty Ten child theme.
    Maybe it’ll help somebody ‘cos I’ve seen many fight with this issue.

  • The topic ‘Superfish nav-bar – the useful tip’ is closed to new replies.