You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes users want the animation to begin at the middle of the screen instead of at the bottom. Or they want the animation to end early before the element leaves the view. See react-scroll-parallax #157
To allow this an option can be added to scale the view size (the portion of the scroll area where the element animates).
The new option viewportSize should accept pixels or percent values via the box model. Percent would be based off the view size.
viewportSize: [top, right, bottom, left]
Examples
To configure an element to start animating at the middle of the screen the bottom of the view is adjusted to half the view size:
viewportSize: [0, 0, 50%, 0]
To configure an element to end animating at the middle of the screen the top of the view is adjusted to half the view size:
viewportSize: [50%, 0, 0, 0]
The text was updated successfully, but these errors were encountered:
Sometimes users want the animation to begin at the middle of the screen instead of at the bottom. Or they want the animation to end early before the element leaves the view. See react-scroll-parallax #157
To allow this an option can be added to scale the view size (the portion of the scroll area where the element animates).
The new option
viewportSize
should accept pixels or percent values via the box model. Percent would be based off the view size.viewportSize: [top, right, bottom, left]
Examples
To configure an element to start animating at the middle of the screen the bottom of the view is adjusted to half the view size:
viewportSize: [0, 0, 50%, 0]
To configure an element to end animating at the middle of the screen the top of the view is adjusted to half the view size:
viewportSize: [50%, 0, 0, 0]
The text was updated successfully, but these errors were encountered: