Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Drop down menu

Drop down menu

Scheduled Pinned Locked Moved General Discussion
29 Posts 12 Posters 5.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M mariusjopen
    May 11, 2017, 6:30 PM

    Hi hgbnd,

    sorry for the late reply!

    Try this:

    nav.primary .sub-menu {
        display: none;
        position: absolute;
        left: 0;
        background-color: white;
        border: 0px solid grey;
        padding-top: 20px;
    }
    

    To explain the issue:

    The top: 30px in the old code made the whole submenu move down.
    Then there was a gap between the top menu and the sub menu.
    And when you reach that gap with your cursor, the hovering stops.
    So what I did here was to remove the gap by removing the top: 30px.

    Then I added a padding-top: 20px which moves the box down as well. But with padding it can still be touched by the cursor.

    Many wishes!

    Marius

    H Offline
    H Offline
    hgbnd
    wrote on May 18, 2017, 3:33 PM last edited by
    #12

    @mariusjopen Works great now, thank you! However, how do I increase the space between sub menu items?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mariusjopen
      Global Moderator
      wrote on May 21, 2017, 10:09 AM last edited by
      #13

      Hey Hugo,

      This will do the job:

      .sub-menu li {
          margin-top: 4px;
      }
      

      If you right-click on your website you can use the Inspector tool. There you can see the HTML and the CSS code. You can even display elements, when they are hidden, because the mouse does not hover on them. (Like your menu)

      If you play around with that you can find out those things very easily.

      All the best!

      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • E Offline
        E Offline
        erikbunger
        wrote on Dec 12, 2017, 12:26 PM last edited by
        #14

        Thanks everyone for the tips with how to create a sub-menu.

        However after putting this code into the 'custom css for desktop' it gets activated for the mobile version as well? Is there a way I can use it only for the desktop only? In the mobile version I would like all the menu points (including the submenus) to just line up under each other.

        Many Thanks

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mariusjopen
          Global Moderator
          wrote on Dec 12, 2017, 12:59 PM last edited by
          #15

          Hi @erikbunger
          which code did you put in?

          All the best!

          Marius

          www.mariusjopen.world

          1 Reply Last reply
          0
          • E Offline
            E Offline
            erikbunger
            wrote on Dec 12, 2017, 2:44 PM last edited by
            #16

            Thanks for your quick response @mariusjopen. The one below. It was posted by @arminunruh in another thread in this forum:

            /submenu/
            nav.primary .sub-menu li{
            display: block;
            position: relative;
            }
            .sub-menu{
            padding-top: 1px!important;
            opacity: 0;
            transition: opacity 200ms ease;
            -webkit-transition: opacity 200ms ease;
            pointer-events: none;
            position: absolute;
            }
            nav.primary li:hover .sub-menu{
            opacity: 1;
            pointer-events: auto;
            }
            /**/

            To be honest, what I really would prefer would be to have the possibility to do a second independent menu (and not a drop down) but I guess this is not possible at this stage in Laytheme?

            Cheers
            /Erik

            1 Reply Last reply
            0
            • E Offline
              E Offline
              erikbunger
              wrote on Dec 12, 2017, 2:48 PM last edited by
              #17

              And here is the website in question.

              erikbunger.com

              Cheers
              /Erik

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mariusjopen
                Global Moderator
                wrote on Dec 14, 2017, 10:59 AM last edited by
                #18

                Hi @erikbunger

                on mobile pages you do not have a hover. So you probably need to open the menu when you click on it.

                You might achieve that with jQuery I assume. It will be a bit tricky. because if you would click on the parent link to open the submenu – then the link should not get activated. Otherwise you get forwarded to the next page before the sub-menu opens.

                For now I do not see a simple solution for this.

                But we might work on that in the future.

                All the best!

                Marius

                www.mariusjopen.world

                1 Reply Last reply
                0
                • E Offline
                  E Offline
                  erikbunger
                  wrote on Dec 14, 2017, 4:21 PM last edited by
                  #19

                  Thanks @mariusjopen for your answer. The real problem for me is that there no way to do a second menu. I would prefer this to a dropdown menu. I really like laytheme but I find this to be a major disadvantage. So if I could suggest anything it would be to add that feature. It seems like there are more users waiting for this feature. I imagine it would not be too hard to add this possibility?

                  Cheers

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    louis999
                    wrote on Jan 22, 2020, 12:12 AM last edited by
                    #20

                    Hi ! Nice option here. Thanks for the help. I am wondering, is there anyway to animate the dropdown so the submenu list item appears one by one ?

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mariusjopen
                      Global Moderator
                      wrote on Jan 23, 2020, 9:50 AM last edited by
                      #21

                      Dear @lucienng
                      to understand you correctly.
                      You do not want a dropdown-sub-menu? You want a second menu?
                      This is possible with Laytheme. In menu-options.

                      Sorry for asking.

                      Best!

                      Marius

                      www.mariusjopen.world

                      1 Reply Last reply
                      0
                      • L Offline
                        L Offline
                        Laura S.
                        wrote on Aug 14, 2020, 4:34 PM last edited by
                        #22

                        Hello,
                        I am also currently creating a dropdown-sub-menu and have two questions.

                        1. I am wondering how to make just the writing visible (no background colour at all).
                          In the thread above was a solution for transparent but not invisible.
                        2. Is it possible to regulate the space between the menu points?
                          I would like to shorten the space between the menu point "about" and
                          "documentation" and to enlarge it between "documentation" and "event"

                        Thank you very much in advance!

                        Here also my link: https://www.udk-schau.de

                        Screen Shot 2020-08-14 at 18.20.13.png

                        L 1 Reply Last reply Aug 15, 2020, 6:30 AM
                        0
                        • L Laura S.
                          Aug 14, 2020, 4:34 PM

                          Hello,
                          I am also currently creating a dropdown-sub-menu and have two questions.

                          1. I am wondering how to make just the writing visible (no background colour at all).
                            In the thread above was a solution for transparent but not invisible.
                          2. Is it possible to regulate the space between the menu points?
                            I would like to shorten the space between the menu point "about" and
                            "documentation" and to enlarge it between "documentation" and "event"

                          Thank you very much in advance!

                          Here also my link: https://www.udk-schau.de

                          Screen Shot 2020-08-14 at 18.20.13.png

                          L Offline
                          L Offline
                          Laura S.
                          wrote on Aug 15, 2020, 6:30 AM last edited by
                          #23

                          Sorry I think I have to tag you. @mariusjopen
                          My first time posting.

                          1 Reply Last reply
                          0
                          • RichardR Offline
                            RichardR Offline
                            Richard
                            Global Moderator
                            wrote on Aug 17, 2020, 1:34 PM last edited by
                            #24

                            Dear @lucienng

                            I am currently seeing no top menu? -

                            However using the "Custom CSS" area in "Lay options" you can achieve the spacing you desire.

                            Screen Shot 2020-08-17 at 3.34.00 PM.png

                            Each Menu item will have its own ID which you can target with CSS

                            For Example

                            
                            #menu-item-119{
                            
                            padding-bottom: 50px;
                            
                            }
                            
                            

                            Would create 50px of "padding" - distance underneath e.g Documentation.

                            For More information on how to find the ID of the Menu items first make sure they exist on the page and then use the inspection tool:

                            https://www.khanacademy.org/computing/computer-programming/html-css/web-development-tools/a/using-the-browser-developer-tools

                            And for More information on CSS:

                            https://www.khanacademy.org/computing/computer-programming/html-css

                            Once you have the menu visible we can take a look at making it invisible :)

                            Best wishes
                            Richard

                            1 Reply Last reply
                            0
                            • L Offline
                              L Offline
                              Laura S.
                              wrote on Aug 17, 2020, 2:28 PM last edited by
                              #25

                              @Richard-Keith said in Drop down menu:

                              Hey Thank you! I will try it now -

                              Sorry I just tried something out and accidentally hide it for a short time. Its on now again :) (and most importantly wound disappear ;)

                              1 Reply Last reply
                              0
                              • RichardR Offline
                                RichardR Offline
                                Richard
                                Global Moderator
                                wrote on Aug 18, 2020, 2:47 PM last edited by
                                #26

                                @Laura-S

                                Cool! :)

                                Let me know how you go

                                Best
                                Richard

                                1 Reply Last reply
                                0
                                • N Offline
                                  N Offline
                                  ninaverena
                                  wrote on Oct 13, 2020, 12:57 PM last edited by
                                  #27
                                  This post is deleted!
                                  1 Reply Last reply
                                  0
                                  • L Offline
                                    L Offline
                                    laboka
                                    wrote on May 3, 2021, 11:20 AM last edited by
                                    #28
                                    This post is deleted!
                                    1 Reply Last reply
                                    0
                                    • B Offline
                                      B Offline
                                      bdale
                                      wrote on Sep 27, 2021, 9:48 PM last edited by bdale Sep 27, 2021, 6:16 PM
                                      #29
                                      This post is deleted!
                                      1 Reply Last reply
                                      0
                                      Reply
                                      • Reply as topic
                                      Log in to reply
                                      • Oldest to Newest
                                      • Newest to Oldest
                                      • Most Votes


                                      I also code custom websites or custom Lay features.
                                      💿 Email me here: 💿
                                      info@laytheme.com

                                      Before you post:
                                      1. When using a WordPress Cache plugin, disable it or clear your cache.
                                      2. Update Lay Theme and all Lay Theme Addons
                                      3. Disable all Plugins
                                      4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

                                      This often solves issues you might run into

                                      When you post:
                                      1. Post a link to where the problem is
                                      2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                                      3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                                      Online Users
                                      I
                                      itsmarkjohn
                                      11 minutes ago
                                      Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                                      laytheme.com
                                      • Login

                                      • Don't have an account? Register

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Recent
                                      • Tags
                                      • Popular
                                      • Users
                                      • Search