Lay Theme Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Hide the menu bar until scroll

    General Discussion
    2
    4
    275
    Loading More Posts
    • 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
      zippitybop last edited by

      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 Reply Quote 0
      • mariusjopen
        mariusjopen Global Moderator last edited by

        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 Reply Quote 0
        • Z
          zippitybop last edited by

          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 Reply Quote 0
          • mariusjopen
            mariusjopen Global Moderator last edited by

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

            Best!

            Marius

            www.mariusjopen.world

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            Before you post

            Use the Search Feature. Maybe there is already a solution to your issue.

            1. Update Lay Theme and all Lay Theme Addons
            2. Disable all Plugins
            3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
            4. Now see if your problem solved itself
            5. Go here, see if your problem is listed here:
            Troubleshooting

            When you post:
            1. Post a link to where the problem is
            2. If the problem is difficult to explain, post screenshots / link to a video to explain it

            Thanks!

            Online Users

            Recent Topics

            • N

              website blank.

            • S

              Theme crashed - because of Polylang?

            • S

              New fade-in / opacity bug?

            • A

              Unable to update lay theme / to login wp admin

            laytheme.com