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. Using a text link as a 'Close' icon for Overlay Menu

Using a text link as a 'Close' icon for Overlay Menu

Scheduled Pinned Locked Moved General Discussion
10 Posts 2 Posters 106 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 Offline
    M Offline
    MWPA
    wrote on last edited by
    #1

    I’d like to use a simple text link (e.g. “Close”> Sluit in Dutch) to close my Overlay Menu instead of an icon. I know it’s possible to choose “Text” as the icon type, but then I also need to position it manually.

    The available positioning options don’t align with the custom grid layout I’m using for my menu, which makes it hard to place the close text exactly where I want it.

    Here’s the website I’m working on – click on Menu to see what I mean:

    https://dev.vandersalm-architecten.nl/

    Is there a way to use a text-based close link that integrates better with my custom layout?

    Thanks in advance!

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

      Hey there. You will need to use custom CSS to do this. If we look at the Chrome inspector and look at how your menu item is positioned, we see this:

      Screenshot 2025-04-18 at 10.34.23.png

      we find its this:
      eft: calc(16px + (100% - 32px) / 8 * 4 + 6px);

      so add a class to ur Sluit button:

      myclose

      .myclose{
          position: absolute!important;
          left: calc(16px + (100% - 32px) / 8 * 4 + 6px)!important;
      }
      
      1 Reply Last reply
      0
      • M Offline
        M Offline
        MWPA
        wrote on last edited by
        #3

        Hi Armin, thanks for your response!

        I understand that with your solution I can reposition the standard "close" text button. However, I’m now working with a custom text-based menu and I would like to use a text link (e.g. "Sluit") to close the overlay menu, instead of an icon.

        I’m unsure how to properly link this text to the closing functionality of the overlay.
        Could you please clarify:

        • Is there a specific class or method that can be used to trigger the overlay close functionality when clicking on a text link like “Sluit”?
        • If so, could you provide guidance on how to implement this, so the text link behaves just like the existing close icon (without needing additional positioning adjustments)?

        Thank you in advance for your help!

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

          Hey, but when I click on the Sluit button, the overlay closes.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MWPA
            wrote on last edited by
            #5

            Yes, at the moment it's just a link to the homepage, so it doesn’t actually trigger the overlay to close. What I’m looking for is functionality that simply closes the overlay and returns the user to the previous page, regardless of where they came from.

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

              ah ok
              and why dont u use x close icon: icon type of text?
              Screenshot 2025-04-24 at 14.19.16.png

              another thing you can do:
              right click the column of the text. and give it the class:

              overlay-close

              now clicking it will close the overlay

              1 Reply Last reply
              0
              • M Offline
                M Offline
                MWPA
                wrote on last edited by
                #7

                Thanks gain @arminunruh

                If I use the standard text option, I need to manually adjust the positioning to make it fit within my text-based menu layout.

                When I add the overlay-close class to the column, it works – but then the entire column becomes a clickable close area, which isn’t what I want.

                I tried adding the class only to the link, like this:

                <a href="#" class="overlay-close">Sluit</a>
                

                But when I do that, the link disappears entirely.

                Do you know why this might be happening, and how I can apply the overlay-close functionality only to the Sluit text link?

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

                  ah its because overlay-close class also uses the standard overlay close icon css

                  pls update lay theme now to version 8.6.3

                  then use this class instead:

                  user-overlay-close
                  

                  this should work better

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    MWPA
                    wrote on last edited by
                    #9

                    Rock solid, thanks so much Armin!

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

                      im happy it works for u!

                      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