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

I have a scenario where the container changes its position from fixed to relative, during scrolling. I

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745377972a4625089.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信