Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8938337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:36:06+00:00 2026-06-15T10:36:06+00:00

I use the jQuery Waypoints library to modify the position of a menu bar

  • 0

I use the jQuery Waypoints library to modify the position of a menu bar container from static to fixed. When the browser window is scrolled down to the menu bar, the bar is fixed to the top of the window.

When scrolling slowly to/past the waypoint, the state change appears to happen smoothly, but when I scroll with normal speed, a slight jump/bounce happens to the menu bar content.

Markup:

<div class="wrapper">
  <div class="less"></div>
  <div class="container">
    <nav>
      <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Clients</a></li>
        <li><a href="#">Contact Us</a></li>
      </ul>
    </nav>
  </div>
  <div class="more"></div>
</div>​

Relevant CSS:

.container {
  height: 50px;
}
nav {
  background: #cdce12;
  height: 50px;
}
nav ul {
  margin: 0;
  padding: 0;
}
nav li {
  display: inline-block;
}
.sticky nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

Here’s the jQuery code:

$(function() {
  var $container = $('.container');
  var $b = $('body');
  $container.waypoint({
    handler: function(event, direction) {
      $b.toggleClass('sticky', direction === 'down');
      event.preventDefault();
    }
 });
});​

I’ve set up a JSFiddle to illustrate the problem and I wonder if it’s possible to prevent this effect to happen?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:36:07+00:00Added an answer on June 15, 2026 at 10:36 am

    You can make it better by setting the scroll throttle to 0, however there is still a tiny bounce.

    $.waypoints.settings.scrollThrottle = 0;
    

    http://jsfiddle.net/FHvha/3/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use jQuery to get values of presaved elements from some websites, using paths
I use jQuery to get the browser version like this: var x = $.browser.version;
We use jQuery modal dialog box to get confirmation from users before they delete
I use jQuery to display an accordion menu when clicking on a menu title.
I use jQuery's $.post to get data from php[from mysql] file data, what we
I'm trying to use the Waypoints plugin for jQuery to lazy load elements on
I use jQuery jFeed plugin to fetch rss feed from WordPress blog and show
I use jQuery to get jsonData from the server. I don't know what the
I use jQuery to create a Popup Window (UI). If I use the code
I use the plugin waypoints ( http://imakewebthings.com/jquery-waypoints/ ) * EDIT : working solution :

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.