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 7174077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:57:27+00:00 2026-05-28T15:57:27+00:00

jquery waypoints fires a callback, when a object appears into viewport with scrolling. This

  • 0

jquery waypoints fires a callback, when a object appears into viewport with scrolling. This works fine for basic implementation.

Now I try to give two waypoints to the same ‘article’ tag, one right now when the <article /> appears, another one when the <article /> is visible 121px from the top: offset: 121 (on scrolling down the page).

// waypoint 1
$.aquaverde.article.waypoint(function(event, direction) {
        currentIndex = $(this).index();
        if (direction === "down") {
            $.aquaverde.wrapper.find('.fixed:eq('+ currentIndex +')').show().siblings(".fixed").hide();
        }
});

// waypoint 2
$.aquaverde.article.find('.page').waypoint(function(event, direction) {
        if (direction === "down") {
            $.aquaverde.wrapper.find(".fixed").hide();
        }
    },{
    offset: 121
});

unfortunately, the plugin fires both callbacks when the object is 121px from the top, so, the second configuration takes dominance.

OK, then I tried to do a chained call:

// waypoint 1
$.aquaverde.article.waypoint(function(event, direction) {
        currentIndex = $(this).index();
        if (direction === "down") {
            $.aquaverde.wrapper.find('.fixed:eq('+ currentIndex +')').show().siblings(".fixed").hide();

            // waypoint 2
            $(this).waypoint(function(event, direction) {
                $.aquaverde.wrapper.find(".fixed").hide();
            },{
                offset: 121             
            });
        }
});

But it give’s me exactly the same result like the one above.
Any ideas to solve that?

http://imakewebthings.github.com/jquery-waypoints/

Thank you.

  • 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-05-28T15:57:28+00:00Added an answer on May 28, 2026 at 3:57 pm

    UPDATE: Everything below is true for jQuery Waypoints 1.x. Since the original answer, Waypoints 2.0 has been released and includes support for multiple waypoints on the same element. The OP’s method of just calling waypoint twice should just work. (Though the callback signature has changed to just one parameter, direction.)


    This currently isn’t possible with jQuery Waypoints. Each element can only have one offset, so the second one overrides the first. It’s a bit buried, but there was an issue opened on this before. My response there provides two methods for working around this limitation:

    • Use a second element, be it a wrapper or any other element with the same offset on the page as your article element.
    • Use a different plugin, in-view in the case of the GitHub issue.

    Those are your best bets for now. I’ve created a new issue for this, as it would be useful, but requires some serious revision to the plugin.

    UPDATE: The above answer remains true. In your specific case, what you’re trying to do in using the child element will work just fine, but you should add an event.stopPropagation() call within the child waypoint so that the event doesn’t bubble and fire the article waypoint, effectively wiping out your hide call.

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

Sidebar

Related Questions

Jquery UI Dialog modal-form doesn't shows up inside table, but works fine outside. This
Jquery validate works fine for webpage with single form. However, when i call the
Jquery has a great language construct that looks like this: $(document).ready(function() { $(a).click(function() {
jQuery provides a browser neutral library for accessing and manipulating the DOM. This is
jQuery's getScript function doesn't seem to support an error callback function. I can't use
jQuery('td[class=bgoff]').each(function() { var td = jQuery(this); ... no apply selector to this only });
jQuery uses this pattern. Essentially it involves every method returning a reference to the
Jquery question So i got if condition, in this condition I make div visible
jQuery(document).ready(function ($) { $('body').keypress(function (e) { alert(e.which); }); }); This will pop up an
I'm reading the documentation here: jQuery, Waypoints, plugin docs . And I'd like to

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.