leafo / sticky-kit

A jQuery plugin for creating smart sticky elements
http://leafo.net/sticky-kit
2.9k stars 517 forks source link

Performance for long DOM text #191

Closed TomThak closed 8 years ago

TomThak commented 8 years ago

Hello, I have serious problems with performance of the plug in, when there is a really long DOM document. If I fix like 3elements and I have really long parent with many texts like legislation document, it totaly freezes any browser if I apply the plug in.

leafo commented 8 years ago

Performance should be no different than using position: fixed as long as you're not telling it to update every scroll frame. Can you show the code you're using to initialize the library?

leafo commented 8 years ago

Closing this, open again if you have more information.

For anyone curious about performance, make sure you're not using recalc_every: 1 since it causes a lot of work to be done in the scroll handler.