• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Sticky menu appears always, not just after scroll down

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Sticky menu appears always, not just after scroll down

This topic is: not resolved

Tagged: sticky menu

  • This topic has 6 replies, 2 voices, and was last updated 11 years, 5 months ago by tblogster.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • November 18, 2014 at 1:26 pm #132022
    tblogster
    Member

    I followed this tutorial to put a sticky menu in site built on Metro Pro theme.
    http://my.studiopress.com/tutorials/sticky-menu/
    Now the sticky menu works, but it is also there when you load the page, even before you start scrolling. that means it covers the header and is redundant.
    What can i do to make it appear only after a certain amount of scrolling?

    Note: the tutorial css code included a "display: none" which i had to delete, otherwise the sticky menu would never appear at all.

    Thanks for your help!

    http://sephardicvoice.com/
    November 18, 2014 at 3:22 pm #132036
    Lauren @ OnceCoupled
    Member

    If the menu never appeared without you manually removing the "display: none" code, that means your javascript wasn't working. The javascript will dynamically turn on and off the "display: none", so you need that code after all. Then, have a closer look at if your javascript is being included properly!

    Best,
    Lauren


    We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com

    November 19, 2014 at 12:59 am #132079
    tblogster
    Member

    Thanks for your response, Lauren.
    I followed the tutorial for the javascript file.
    the file path is /public_html/wp-content/themes/metro-pro/js/sticky-menu.js
    That seems to be correct.
    The content of the js file were copied from the tutorial:

    jQuery(function( $ ){
    $(window).scroll(function() {
    var yPos = ( $(window).scrollTop() );
    if(yPos > 200) { // show sticky menu after screen has scrolled down 200px from the top
    $(".nav-secondary").fadeIn();
    } else {
    $(".nav-secondary").fadeOut();
    }
    });
    });

    So what have I done wrong?

    November 19, 2014 at 3:14 pm #132200
    Lauren @ OnceCoupled
    Member

    When I load your site, I don't see the javascript file being called. You need to check that the file is located in the correct place, and that it's being enqueued.

    Also, when you post code, use the proper code tags around it. This will display it properly, and prevent it from (potentially) breaking readers' sites.


    We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com

    November 20, 2014 at 1:29 pm #132310
    tblogster
    Member

    It is in the right place, according to the tutorial. and the enqueue command is in the functions.php
    so what do i do?

    November 20, 2014 at 1:32 pm #132311
    Lauren @ OnceCoupled
    Member

    If I go to http://sephardicvoice.com/wp-content/themes/metro-pro/js/sticky-menu.js, I do not see your file.


    We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com

    November 21, 2014 at 4:19 am #132359
    tblogster
    Member

    good point. you can see it there now.
    still now sticky menu.
    thanks for your help on this!

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble