Reset onload flag when recalculate called

This ensures sticky elements don't fade in if
in a sticky position when the page loads.

The fade is there to show when an element is
becoming sticky. This has no use if it was already
sticky the first time you see it.

Because the same situation applies when
recalculate is called, we also want the flag to be
reset before this happens.
This commit is contained in:
Tom Byers
2019-01-16 11:38:14 +00:00
parent a9b7a0d887
commit 98789c98c8

View File

@@ -462,6 +462,9 @@
}
if (numOfEls) {
// reset flag marking page load
this._initialPositionsSet = false;
$els.each(function (i, el) {
// delay setting position until all stickys are loaded
self.add(el, false, onLoaded);