2

Is it possible to have multiple anchor targets for a single element with Skrollr? For example, I need something like the following:

<section id="main-slide"
                 data-start="background-color:rgb(255,255,255);"
                 data-top-top="background-color:rgb(255,0,0);"
                 data-anchor-target="#slide1"

                 data-top-top="background-color:rgb(255,0,0);"
                 data-bottom-top="background-color:rgb(0,255,0);"
                 data-anchor-target="#slide2">

And so, it's like I have the first set of scroll animation relative to #slide1, and then as I continue to scroll, I should trigger the second set of scroll animation relative to #slide2.

I've tried the code above, but it didn't get Skrollr to work correctly.

How can I have multiple anchor targets?

Carven
  • 14,988
  • 29
  • 118
  • 161

1 Answers1

0

I don't think this is possible - you are initialising the same attributes twice (data-top-top & data-anchor-top). You could try using skrollr keyframing to pipe events from #slide1 & #slide2 to your own event handler.

schanq
  • 864
  • 1
  • 15
  • 25