The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Multiple divs with same CLASS (jQuery Waypoints)

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #207780

    I have followed this tutorial: successfully. I would like to apply the fadein on almost every element on the page. This means using this jQuery method that I would ned to create separate Classes for each element and duplicate the code, because otherwise every element with the same class currently fades in with the first Waypoint only.

    Here is what I had:
    // hide our element on page load
    $(‘.fade-in’).css(‘opacity’, 0);

    $(‘.fade-in’).waypoint(function() {
    }, { offset: ‘95%’ });
    By following this page, I tried to adapt it to have:

    But I couldn’t get it to work…any ideas please? (My Jquery could well be a bit off)

    // hide our element on page load
    $(‘.fade-in’).css(‘opacity’, 0);

    var sticky = [];
    sticky[idx] = new Waypoint.Sticky({ element: this });
    $({element: this}).addClass(‘fadeInUp’);

    I’m also not sure how to add in the offset part.

    Very many thanks

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.