Skip to content

Instantly share code, notes, and snippets.

@olleman42
Forked from johancz/gist:1411888
Created November 30, 2011 23:35
Show Gist options
  • Save olleman42/1411893 to your computer and use it in GitHub Desktop.
Save olleman42/1411893 to your computer and use it in GitHub Desktop.

Revisions

  1. olleman42 revised this gist Nov 30, 2011. 1 changed file with 8 additions and 6 deletions.
    14 changes: 8 additions & 6 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,17 @@
    $(function() {
    // LOL FORK

    $("#menu-mainmenu li>ul").each(function() {
    if ($(this).parent().hasClass("current-menu-item") == false) {
    $(this).hide();
    var submeny = $(this);
    if (submeny.parent().hasClass("current-menu-item") == false) {
    submeny.hide();
    }

    });

    $("#menu-mainmenu li>ul>li").each(function() {
    if ($(this).hasClass("current-menu-item") == true) {
    $(this).parent().show();
    var sublank = $(this);
    if (sublank.hasClass("current-menu-item") == true) {
    sublank.parent().show();
    }

    });
    @@ -18,7 +20,7 @@ $(function() {
    var laenken = $(this);
    laenken.parent().parent().find("ul").hide();
    laenken.parent().find("ul").show();

    $("nav li").removeClass("current-menu-item current_page_item");
    laenken.parent().addClass("current-menu-item current_page_item");

  2. olleman42 revised this gist Nov 30, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    $(function() {

    // LOL FORK
    $("#menu-mainmenu li>ul").each(function() {
    if ($(this).parent().hasClass("current-menu-item") == false) {
    $(this).hide();
  3. @invalid-email-address Anonymous created this gist Nov 30, 2011.
    29 changes: 29 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    $(function() {

    $("#menu-mainmenu li>ul").each(function() {
    if ($(this).parent().hasClass("current-menu-item") == false) {
    $(this).hide();
    }

    });

    $("#menu-mainmenu li>ul>li").each(function() {
    if ($(this).hasClass("current-menu-item") == true) {
    $(this).parent().show();
    }

    });

    $(".emptyNav > a").click(function() {
    var laenken = $(this);
    laenken.parent().parent().find("ul").hide();
    laenken.parent().find("ul").show();

    $("nav li").removeClass("current-menu-item current_page_item");
    laenken.parent().addClass("current-menu-item current_page_item");

    console.log("clicked klasser");
    return false;
    });

    });