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. Off canvas Menu

Off canvas Menu

Scheduled Pinned Locked Moved General Discussion
6 Posts 3 Posters 252 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
    amcd125
    wrote on Jan 28, 2020, 3:21 AM last edited by
    #1

    Hey I was wondering if it is possible to have an off-canvas menu simular to this https://www.polytechnic.works/

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mariusjopen
      Global Moderator
      wrote on Jan 29, 2020, 9:32 AM last edited by
      #2

      Dear @amcd125
      with some CUSTOM CSS this is possible.
      Probably you could also use the mobile-menu for this.

      Best!

      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • A Offline
        A Offline
        amcd125
        wrote on Jan 30, 2020, 2:21 AM last edited by amcd125 Jan 29, 2020, 9:22 PM
        #3

        Thanks Manus. How would one be able to set up the mobile menu for desktop?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mariusjopen
          Global Moderator
          wrote on Feb 3, 2020, 10:48 AM last edited by
          #4

          Dear @amcd125
          you would probably need to play around with the CUSTOM CSS or a bit with the Javascript.

          Are you familiar with this?
          There are good tutorials for free on Codeacademy.

          Best!

          Marius

          www.mariusjopen.world

          1 Reply Last reply
          0
          • C Offline
            C Offline
            comedowntous
            wrote on Feb 4, 2020, 2:49 PM last edited by
            #5

            Hi @amcd125 - I achieved this using the following code here:

            w3 schools

            You would have to add the code into the custom css + html sections of lay theme settings:

            UNDER CUSTOM HTML:

            <div id="myNav" class="overlay">
              <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
              <div class="overlay-content">
                <a href="/myfirstlink">link 1</a>
                <a href="/mysecondlink">link 2</a>
                <a href="/mythirdlink">link 3</a>
                <a href="/myfourthlink">link 4</a>
              </div>
            </div>
            
            <span class="layovermenu" style="font-size:30px;cursor:pointer" onclick="openNav()">MENU</span>
            

            Under CUSTOM <HEAD> CONTENT :

            /* Open */
            function openNav() {
              document.getElementById("myNav").style.display = "block";
            }
            
            /* Close */
            function closeNav() {
              document.getElementById("myNav").style.display = "none";
            }
            

            UNDER CUSTOM CSS:

            /* overlay menu */
            .overlay {
              height: 100%;
              width: 100%;
              display: none;
              position: fixed;
              z-index: 4;
              top: 0;
              left: 0;
              background-color: rgb(255,255,255);
              background-color: rgba(0,0,0);
            }
            
            .overlay-content {
              position: relative;
              top: 25%;
              width: 100%;
              text-align: center;
              margin-top: 30px;
            }
            
            .overlay a {
              font-family: Futura Pro Bold;
              padding: 8px;
              text-decoration: none;
              font-size: 36px;
              color: #ffffff;
              display: block;
              transition: 0.3s;
            }
            
            .overlay a:hover, .overlay a:focus {
              color: #ffffff;
            }
            
            .overlay .closebtn {
              position: absolute;
              top: 20px;
              right: 45px;
              font-size: 60px;
            }
            
            .layovermenu {
                font-family: Futura Pro Bold;
                position:fixed;
                width: 100%;
                text-align: center;
                z-index: 3;
            }
            
            @media screen and (max-height: 450px) {
              .overlay a {font-size: 20px}
              .overlay .closebtn {
              font-size: 40px;
              top: 15px;
              right: 35px;
              }
            

            I added the class 'layovermenu' in order to change the font and better position the menu link.

            This works great on the desktop version but on mobile the overlay does not show - any tips? @mariusjopen

            Thank you!

            1 Reply Last reply
            0
            • C Offline
              C Offline
              comedowntous
              wrote on Feb 4, 2020, 2:51 PM last edited by
              #6

              Make sure to add <script></script> in between your custom <head> content. The correct way to place this would be:

              <! –– OVERLAY MENU ––>
              
              <script>
              function openNav() {
                document.getElementById("myNav").style.display = "block";
              }
              
              function closeNav() {
                document.getElementById("myNav").style.display = "none";
              }
              </script>
              <! –– OVERLAY MENU ––>
              
              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes

              1/6

              Jan 28, 2020, 3:21 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
              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.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Recent
              • Tags
              • Popular
              • Users
              • Search