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. Hide the menu bar until scroll

Hide the menu bar until scroll

Scheduled Pinned Locked Moved General Discussion
4 Posts 2 Posters 475 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.
  • Z Offline
    Z Offline
    zippitybop
    wrote on last edited by
    #1

    Hi Marius and Armin!

    really enjoying the speed I can achieve with lay theme! However I have hit a wall.

    I would like to hide the menu bar, logo and menu items until the user starts scrolling. I have to admit I'm not good at jQuery, so I am a little lost.

    I've tried following this support item but it only hides the menu items (currently still have the code in <head>) and it is a bit janky in the sense that it doesnt work until I have started scrolling back up.

    and I've found this on StackOverflow but I'm not sure how to adapt it to my page (sh*t at jQuery).

    My website is http://wordpress.p507516.webspaceconfig.de/.

    Thanks in advance,
    Darius

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

      Dear @zippitybop
      you want to hide the whole white bar or only the menu in it?

      jQuery is not so difficult. I will help you a bit:

      1. Hide the Navigation with CSS and opacity 0
        https://developer.mozilla.org/de/docs/Web/CSS/opacity
      .primary {
      opacity: 0;
      }
      
      1. Make a jQuery function which gets active on scroll
        https://api.jquery.com/scroll/

      2. When you scroll you add a class to the body of the website which is called scroll
        https://api.jquery.com/addclass/

      3. Write a CSS which shows the navigation when the body has the class scroll

      .scroll .primary {
      opacity: 1 !important;
      }
      

      That should work.
      If you want to be more sophisticated, you can have another look in the Stackoverflow you sent me.

      Best!

      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        zippitybop
        wrote on last edited by
        #3

        Hi again Marius,

        I WILL try this, thanks dude! I wanted to hide the entire white bar, logo and menu items.

        I'll set up another staging and see how it goes.

        Cheers,
        Darius

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

          Dear @zippitybop
          great! I hope it will work out well!

          Best!

          Marius

          www.mariusjopen.world

          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