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.8k 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.
  • L Offline
    L Offline
    lucienng
    wrote on last edited by
    #6

    For the longest time, I did not know I was the one who created this thread. Thanks for replying Armin! The code works, but just wanted to check, I've the same small issue as Roisinice, is there a way to let the hover stay a little longer? Thanks!!

    1 Reply Last reply
    0
    • arminunruhA Offline
      arminunruhA Offline
      arminunruh
      Global Moderator
      wrote on last edited by arminunruh
      #7

      Oh I see what you mean. Roisinice this is your code:

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

      top: 30px
      is a bit too much for you.
      try top: 20px

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hgbnd
        wrote on last edited by
        #8

        Hey Armin, I tried to use your code but it doesn't really work on my website. The main menu category slides to the left.

        0_1493504031771_Screen Shot 2017-04-29 at 6.11.58 PM.png

        My website is hugobeniada.com

        Also, how can I add vertical space between sub menu items?

        Thanks so much for your help!

        H 1 Reply Last reply
        0
        • H hgbnd

          Hey Armin, I tried to use your code but it doesn't really work on my website. The main menu category slides to the left.

          0_1493504031771_Screen Shot 2017-04-29 at 6.11.58 PM.png

          My website is hugobeniada.com

          Also, how can I add vertical space between sub menu items?

          Thanks so much for your help!

          H Offline
          H Offline
          hgbnd
          wrote on last edited by
          #9

          Hey @arminunruh, would you be able to help? That'd be highly appreciated. Thanks!

          1 Reply Last reply
          0
          • mariusjopenM Offline
            mariusjopenM Offline
            mariusjopen
            Global Moderator
            wrote on last edited by
            #10

            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

            www.mariusjopen.world

            H 1 Reply Last reply
            0
            • H Offline
              H Offline
              hgbnd
              wrote on last edited by
              #11
              This post is deleted!
              1 Reply Last reply
              0
              • mariusjopenM mariusjopen

                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 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
                • mariusjopenM Offline
                  mariusjopenM Offline
                  mariusjopen
                  Global Moderator
                  wrote on 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 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
                    • mariusjopenM Offline
                      mariusjopenM Offline
                      mariusjopen
                      Global Moderator
                      wrote on 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 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 last edited by
                          #17

                          And here is the website in question.

                          erikbunger.com

                          Cheers
                          /Erik

                          1 Reply Last reply
                          0
                          • mariusjopenM Offline
                            mariusjopenM Offline
                            mariusjopen
                            Global Moderator
                            wrote on 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 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 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
                                • mariusjopenM Offline
                                  mariusjopenM Offline
                                  mariusjopen
                                  Global Moderator
                                  wrote on 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 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
                                    0
                                    • L Laura S.

                                      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 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 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 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
                                          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
                                          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