ScrollMagic icon indicating copy to clipboard operation
ScrollMagic copied to clipboard

unpin after reach other div

Open caturprayogo opened this issue 9 years ago • 4 comments

Hi,

How to unset pinned div when reaching other defined div? Pleaselook at my codepen here: http://codepen.io/caturprayogo/pen/VLRvMO

I'm confuse when I add "duration: 500" it only give blank space. Thank you for help.

caturprayogo avatar Aug 08 '15 04:08 caturprayogo

Here you go: http://scrollmagic.io/examples/expert/cascading_pins.html it is in the examples :)

Master244 avatar Sep 03 '15 08:09 Master244

@Master244 that link doesn't actually show/solve the problem of the title (updated title), it shows how to pin -> unpin -> re-pin the same div and so on.

stevengrimaldo avatar Jan 02 '20 22:01 stevengrimaldo

@caturprayogo another poster asked a similar question here however @janpaepke responded that it was not possible to use a separate div as the trigger to unPin another (previous) pin.

stevengrimaldo avatar Jan 02 '20 23:01 stevengrimaldo

@caturprayogo to answer your question and hopefully clear your confusion though, in the documentation (and primarily seen in the examples) it says:

Note that the first pin pushes down the following elements. A gap with the size of the scene's duration appears.

Then it says you can stop it from doing that by passing the setting pushFollowers to false. Example line of code:

.setPin("#pinned", { pushFollowers: false })

You can read more about pinning here in the basic example or here in the documentation.

stevengrimaldo avatar Jan 02 '20 23:01 stevengrimaldo