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

Home Forums JavaScript ScrollMagic centers pinned object Reply To: ScrollMagic centers pinned object


Hey! Thanks for having a look at this.

The position to the side is where it “should” be the whole time. It’s actually the centring that’s the problem.

I believe the “pinning” shouldn’t affect the position of the object, it should just pin it in place, hence the fixed positioning.

After looking again, it’s now looking like the problem could also be the width:auto set on the container. ScrollMagic introduces a container around pinned objects, and when it reaches the trigger point the width of the container changes from auto to 204px (the width of the object), so even though the object is still centred the container now fits snugly around it.

Either way there must be something wrong here and unsure whether it’s a bug or if I’m misconfiguring it somehow.