%25
I m using framer-motion s layout property to handle this, and it works as expected unless the page has been scrolled, where framer seems to be ignoring the viewport scroll, and treating the element as if it is animating from its original position relative to the top of the page.
百分比25 规定:
- Without scrolling, click on the first card. It will animate correctly.
- Now go back, scroll to the bottom and click on the last card. This time, the card will animate up from below the screen, instead of from it s position within the viewport window.
Is there a way that I can either factor in the scroll distance, or that the element s position is calculated relative to the viewport and not the top of the page?
Example: