Have you ever scrolled down your WordPress site and noticed your sticky menu flicker or jump? 😖 It’s a common problem, especially on sites with dynamic headers or responsive designs.
That small flicker may seem harmless, but it can make your site feel less professional and frustrate visitors. The good news? You can fix sticky menu flicker on scroll with 5 easy steps with a little jQuery, and it works across desktop, tablet, and mobile devices. Let me show you how.
Step 1: Understand Why Sticky Menu Flicker Happens

Sticky menus are meant to remain visible at the top of your page, giving visitors quick access to navigation links as they scroll. However, sometimes they don’t play nicely with fast scrolling.
When a page is scrolled quickly, the browser tries to constantly recalculate the header’s position. If the height changes slightly—or if the JavaScript/CSS transitions aren’t perfectly aligned—the menu can momentarily disappear, jump, or “flicker.”
This often happens when:
- Your header height changes between scrolling states (e.g., logo resizing).
- You have animations or transitions applied to your menu.
- The sticky behavior depends on exact pixel positioning.
If you want to dig deeper into how browsers handle scrolling events, the MDN Web Docs on scroll events offer a great technical explanation.
By fixing it, you’ll make your site look smoother, more professional, and much more user-friendly.
Step 2: Prepare Your WordPress Site for the Fix
Before adding custom code, make sure you:
- Have a child theme or a safe method for adding scripts (e.g., WPCode plugin).
- Back up your site.
- Test changes in a staging environment if possible.

Step 3: Add the jQuery Sticky Menu Fix
Here’s the simple code you can use:
var status_bar_top = $(".status-bar-top").outerHeight();
var lastScrollTop = 0;
$(window).scroll(function(){
var window_pos = $(this).scrollTop();
var topValue = 0;
if( $(window).width() <= 1024 ){
var logo_height = $(".wp-block-site-logo").height();
$("header").css({"top": "-" + logo_height + "px"});
status_bar_top = logo_height;
} else {
if( window_pos < lastScrollTop && window_pos < status_bar_top ){
$(window).scrollTop(topValue); // prevents the flicker
}
}
if( window_pos >= status_bar_top ){
$("header").addClass("now-sticky");
} else {
$("header").removeClass("now-sticky");
}
lastScrollTop = $(this).scrollTop(); // save last scroll position
});If you’re new to jQuery, you can check the official jQuery API documentation to understand each method used here.
Step 4: How the Code Works
- Responsive-Friendly Behavior:
- The code first checks if the screen width is 1024px or less, which covers tablets and mobile devices. It adjusts the header’s position based on your logo height to ensure smooth transitions on smaller screens.
- Flicker Prevention on Scroll Up:
- If the user scrolls upward and hasn’t passed the header’s threshold height, the code briefly locks the scroll position to prevent the header from jumping.
- Sticky Activation:
- Once the user scrolls past the logo height, the
now-stickyclass is added to the header, making it stick to the top. Scrolling back above that point removes the class, returning the header to its original position.
- Once the user scrolls past the logo height, the
Before: the header can flicker when competing scroll or sticky-position rules repeatedly change its position.
After testing: check that the header remains stable while scrolling in both directions, including on mobile.
If you want to understand more about responsive design best practices, Smashing Magazine’s guide to responsive web design is a solid resource.
Step 5: Watch the Code Fix in Action – Sticky Menu Flicker Solved
Want to see exactly how this jQuery code fixes the sticky menu flicker? 🎥
Notice how smooth it feels now? No more sticky menu flicker or jumpy behavior. Your users will thank you for it!
For more sticky menu inspiration, you can explore CodePen’s collection of sticky header examples to see creative variations.
Bonus: Check Your Website’s Performance
If you’d like to learn more about website performance and user experience, try my free Website Performance Checker to see how fast your site loads and get tips for improvement — powered by Gemini AI.


Benefits of Fixing Sticky Menu Flicker
✅ Smooth Scrolling Experience – Users can navigate without sudden jumps or menu disappearance.
✅ Professional Appearance – Your site looks polished and trustworthy.
✅ Mobile-Friendly – Works on smartphones, tablets, and desktops.
✅ Better User Engagement – A smooth experience encourages visitors to stay longer.
✅ Easy to Implement – No complex plugins required—just a short script.
If you’d like to learn more about website performance and user experience, try my free Website Performance Checker to see how fast your site loads and get tips for improvement — powered by Gemini AI.
Final Thoughts & Next Steps
Sticky menu flicker is a small but noticeable problem that can make your site feel less polished. With this 5-step jQuery fix, you can eliminate the issue and give visitors a smooth, frustration-free browsing experience.
Try it out on your WordPress site and watch your header behave perfectly—every scroll, every time! 🚀
📞 Need help optimizing your WordPress site?
Contact us or request your Free Site Audit today and see how we can make your site faster, smoother, and more secure.


