While profiling our Zurb 5 implementation, we noticed a slight bottle neck using the “sticky”
topbar component. The user would sometimes experience a “stutter” or “glitch” while scrolling. And users with lower end devices would experience the issue more often.
update_sticky_positioning is called a lot. Too much. After a couple of good scrolls, hundreds of times.
scroll handler when calling
I introduced a new setting named
scroll_throttle with a default value of 300 milliseconds. Throughout our test cycles the value works well.
sticky function this:
View the pull request. Sure, it’s a slight gain but the stutter is pretty much gone.
Disclaimer: I am a Foundation fan, user, and minor open-source contributor. And yes, I work for a company that sells bras.