最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to resolve fixed position elements jumps when scrolling | React JS, framer-motion - Stack Overflow

programmeradmin0浏览0评论

I have a scenario where the container changes its position from fixed to relative, during scrolling. I have used framer-motion to give a smooth effect during position transitioning. framer-motion is a great library to handle these scenarios, however my code is not working as expected in all browsers. When I scroll to the offset where the position changes from fixed to relative, it jumps and sits in the place, where as am expecting it should be smooth.

I have a scenario where the container changes its position from fixed to relative, during scrolling. I have used framer-motion to give a smooth effect during position transitioning. framer-motion is a great library to handle these scenarios, however my code is not working as expected in all browsers. When I scroll to the offset where the position changes from fixed to relative, it jumps and sits in the place, where as am expecting it should be smooth.

Share Improve this question edited Jul 27, 2020 at 19:20 user12133234 asked Jul 27, 2020 at 17:14 user12133234user12133234 4112 gold badges7 silver badges15 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

You should add "layout" prop to the ponent you are animating. You can read more about it in the docs

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论