Giter VIP home page Giter VIP logo

Comments (5)

russellsamora avatar russellsamora commented on July 30, 2024 1

You should be able to simply create multiple instances... eg:

// instantiate the scrollama
const scroller1 = scrollama();
const scroller2 = scrollama();

// setup the instance
scroller1
  .setup({
    step: '.container-1 .step'
  })

scroller2
  .setup({
    step: '.container-2 .step'
  })

from scrollama.

bclinkinbeard avatar bclinkinbeard commented on July 30, 2024

This is how I've gotten multiple containers running so far. https://codepen.io/bclinkinbeard/pen/JOgdwq?editors=1000

Note you'll have to use the debug view for it to behave correctly, per #38

I just stuck everything inside the init function to avoid the globals created in the demos. If there's a better way I'm all ears. :)

from scrollama.

GitNoise avatar GitNoise commented on July 30, 2024

I implemented a similar solution as yours but as in your example I get the same "error"... onStepEnter is triggered for both scrollers when one of their steps is triggered.

You can see this if you have scroll to the end of the first scroll container and observe the value in the second scroll container without entering it.

from scrollama.

GitNoise avatar GitNoise commented on July 30, 2024

Is this a bug or a feature :)

from scrollama.

GitNoise avatar GitNoise commented on July 30, 2024

As long as the containers aren't next to each other it seems to work fine.

from scrollama.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.