somewebmedia / hc-sticky

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

Absolutely positioned elements within parent containers render incorrectly #36

Closed jaichandra closed 7 years ago

jaichandra commented 7 years ago

When hcSticky() is applied to absolutely positioned elements, the layout breaks.

Refer to below example: http://jsfiddle.net/kleptomac/ju5esLh8/

The sidebar on the right is pushed out of the window when hcSticky() is applied. Commenting out the JS renders the sidebar in the correct position.

Expected behavior: The default layout should not break when hcSticky() is applied to an element.

somewebmedia commented 7 years ago

Obsolete. New major version available.