67

【前端词典】4 种滚动吸顶实现方式的比较

 5 years ago
source link: https://juejin.im/post/5caa0c2d51882543fa41e478
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前言 我入职第二家公司接到的第一个需求就是修复之前外包做的滚动吸顶效果。我当时很纳闷为何一个滚动吸顶会有 bug,后来我查看代码才发现直接用的是 offsetTop 这个属性,而且并没有做兼容性处理。 offsetTop 用于获得当前元素到定位父级( elem

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK