The scroll event is triggered for all instances of hcSticky on the page, even if they're not visible. This was causing a bug where, after scrolling, the hcSticky element which was hidden would snap to the top of the page with fixed positioning. The bug is demonstrated in the following gif:
I have added a check to the onscroll functionality to ensure that the element is visible before continuing. This resolves the bug demonstrated above.
The scroll event is triggered for all instances of hcSticky on the page, even if they're not visible. This was causing a bug where, after scrolling, the hcSticky element which was hidden would snap to the top of the page with fixed positioning. The bug is demonstrated in the following gif:
I have added a check to the onscroll functionality to ensure that the element is visible before continuing. This resolves the bug demonstrated above.