Viewing 15 replies - 16 through 30 (of 38 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Yep

    Thread Starter Chris122

    (@chris122)

    Thanks, just tried it.
    I wanted to do it like this: one click on the first level opens the second level.
    Another click on the second level opens the desired page.
    Probably that is a stupid ideas. I think this would not be working just with css?

    Yep

    So perhaps not a good idea if you want the menu to work cross-browser… ??

    @chris122: Have you thought about using a jQuery accordion menu?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I wasn’t trying to finalise the solution in 1 post, but then I did forget that not everyone uses Chrome ??

    Thread Starter Chris122

    (@chris122)

    @esmi

    I will install it and have a look at it. ??

    Thread Starter Chris122

    (@chris122)

    @esmi,

    I just installed the widget. There is a plugin too. Which one did you mean?

    Thx

    I wasn’t thinking of a specific plugin or widget. Just using jQuery generally.

    Thread Starter Chris122

    (@chris122)

    Okay thanks, I tried everything.
    I think I leave the menu vertical. ??

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Did you look at toggleClass? On click you can add/remove a class. The CSS applied to that class can show the menu, when initially it is hidden.

    Thread Starter Chris122

    (@chris122)

    Thank you, I just checked it, but what can I do with that class?
    I have the Plugin (CSS & JavaScript Toolbox). This plugin allows me to add CSS, html, javascript at desired pages.
    However, I do not know how to setup a submenu in CSS.
    So it′s quite complicated for me.

    Therefore I was thinking, I just leave it, because it might take hours to setup a horizontal submenu.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Try adding this JavaScript to all pages:

    jQuery(document).ready(function($){
     var submenu = $('.sub-menu');
    
     $(submenu).hide().parent().find('a').click(function(e){
    
      e.preventDefault();
      $(this).siblings(submenu).toggleClass('menu-open');
    
     });
    });

    And then this CSS:

    .menu-open { display: block !important; }

    Thread Starter Chris122

    (@chris122)

    Hello Andrew,

    thanks, I just added the javascript and css code, but nothing changed. : (

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    That plugin is broken, which plugin was it?

    Thread Starter Chris122

    (@chris122)

    I used this plugin to add it: CSS & Javascript Toolbox V6 CE
    It is necessary to add the tags (<javascript></javascript> or <style> </style>).
    The plugin works at my case and integrates it.

    But the browser explains me: Invalid character ‘&’ at the JS Code.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I think the plugin is broken because it is converting apostrophes to HTML entities. Can you try copying my code again just in case it is caused by something else?

Viewing 15 replies - 16 through 30 (of 38 total)
  • The topic ‘Change second level vertical menu to horizontal menu’ is closed to new replies.