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. submenu position

submenu position

Scheduled Pinned Locked Moved General Discussion
13 Posts 3 Posters 140 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.
  • A Offline
    A Offline
    alasdair17
    wrote on Jan 22, 2025, 11:21 AM last edited by
    #4

    hmm not quite sure what you mean sorry. Do you have an example?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bbbfg
      wrote on Jan 22, 2025, 11:48 AM last edited by
      #5

      I'll try ;)

      Main menu items top right:
      MAIN 01 - MAIN 02 - MAIN 03 - etc.

      MAIN 02 HAS several submenu items, but these should not be displayed below the navigation item, but ‘somewhere’, e.g. below the logo, separate from the main navigation.

      They may ONLY be displayed on the corresponding pages that are submitted to MAIN 02, if I click on the Menu MAIN 02-Button.

      i made a beautiful scribble, maybe it helps...!

      Bildschirmfoto 2025-01-22 um 12.47.33.png

      1 Reply Last reply
      0
      • A Offline
        A Offline
        alasdair17
        wrote on Jan 22, 2025, 11:52 AM last edited by alasdair17 Jan 22, 2025, 6:53 AM
        #6

        hmm yeah I kinda get it, so when you hover on Main 02 and then hover on Sub02 the 'Sub 01, 02, 03' menu appears down the page? Nice scribble!

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bbbfg
          wrote on Jan 22, 2025, 11:56 AM last edited by
          #7

          I suppose to be an artist ^^

          yes — it must not be on "hover", but on "click" would be fine. The submenu then should always be placed on the pages SUB 01, SUB 02, SUB 03 etc.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alasdair17
            wrote on Jan 22, 2025, 12:01 PM last edited by
            #8

            hmm you might need to use jquery for that which i'm not that well versed in, perhaps @arminunruh or @felix_rabe could help you with that, good luck!

            Perhaps a workaround would be to make those 'sub 01, 02, 03' as text links on their respective pages and use css to hide them on certain pages.

            1 Reply Last reply
            0
            • B Offline
              B Offline
              bbbfg
              wrote on Jan 22, 2025, 12:04 PM last edited by
              #9

              okay, I will see what the will answer me :)

              The workaround I also thought of, but it is the least comfortable.

              Thanks.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                arminunruh
                Global Moderator
                wrote on Jan 28, 2025, 5:23 PM last edited by arminunruh Jan 28, 2025, 12:23 PM
                #10

                hey i tried around a little bit but it doesnt really seem to be easily possible

                i think youd have to create an extra div with anchor tags inside, so create extra html markup in lay options → custom css & html

                and then code javascript to show and hide it

                i dont really have time to code this for you

                maybe try with chatgpt

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  arminunruh
                  Global Moderator
                  wrote on Jan 31, 2025, 7:03 AM last edited by arminunruh Jan 31, 2025, 2:12 AM
                  #11

                  hey yesterday i got an idea of how to do it!

                  put this code in lay options → custom css & html → custom html at bottom:

                  <script>
                      jQuery('.desktop-nav .sub-menu').each(function(index){
                          jQuery(this).addClass('my-submenu-'+index)
                          jQuery(this).appendTo('body');
                      })
                  </script>
                  

                  This will take all submenus found in desktop navigations, and move them so they are a direct child of the HTML body tag.
                  And it gives them a class of:

                  my-submenu-"number"
                  and "fixed-submenu"

                  Screenshot 2025-01-31 at 08.00.52.png

                  meaning if we have multiple submenus, they will be: my-submenu-0 and my-submenu-1

                  now that these are direct children of the body tag, we can do position fixed on them.
                  and for example position the first submenu left 10px and top 100px:

                  .fixed-submenu{
                      position: fixed; 
                      z-index: 20;
                      list-style: none;
                      padding: 0;
                  }
                  
                  .my-submenu-0{
                      left: 10px;
                      top: 100px;
                      display: none;
                  }
                  

                  We add display: none; to the first submenu cause we want it to be hidden and only show up when we click the menu point that should show it.

                  Enter this css in "lay options" -> "custom css & html" -> "custom css for desktop"

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    arminunruh
                    Global Moderator
                    wrote on Jan 31, 2025, 7:09 AM last edited by
                    #12

                    Screenshot 2025-01-31 at 08.03.50.png

                    if this is the menu point, that on click, should toggle this fixed submenu,
                    you would use this js:

                    <script>
                        jQuery('.desktop-nav a[data-id="3106"]').on('click', function(e){
                            e.preventDefault();
                            e.stopPropagation();
                            jQuery('.my-submenu-0').toggle();
                        })
                    </script>
                    

                    also in "html at bottom"

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      arminunruh
                      Global Moderator
                      wrote on Jan 31, 2025, 7:17 AM last edited by
                      #13

                      and now youd also need to decide: when will the submenu be hidden?
                      right now its only hidden, if you click the menu point again that opened it.

                      i think this would hide it if you click any link inside the submenu:

                      <script>
                          jQuery('.fixed-submenu a').on('click', function(e){
                              jQuery(this).closest('.fixed-submenu').hide();
                          })
                      </script>
                      
                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes

                      13/13

                      Jan 31, 2025, 7:17 AM


                      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
                      P
                      pagagne
                      18 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.
                      13 out of 13
                      • First post
                        13/13
                        Last post
                      0
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Search