somewebmedia / hc-sticky

JavaScript library that makes any element on your page visible while you scroll.
https://somewebmedia.github.io/hc-sticky/
MIT License
462 stars 114 forks source link

Remove element size check when attaching scroll function #12

Closed alexcason closed 10 years ago

alexcason commented 10 years ago

With the size check in place it means that the scroll event is never attached when the sticky element is the same size or larger than the content.

However, when the content size can increase dynamically then this means that the sticky element doesn't work correctly, as shown in the following gif.

hc-sticky-bug2

I've removed the check so that the scroll event is always attached. This means that when the content size dynamically changes the sticky element works correctly.

hc-sticky-bug2-resolved

I've also updated the minified javascript.