From: Jérôme Lebleu Date: Sat, 12 Nov 2016 15:31:28 +0000 (+0100) Subject: Ensure that unstuck classes are set on load X-Git-Tag: v6.3-rc1~6^2~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7fc1e60226ab1ce3a516eb715b28c88a329b840;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Ensure that unstuck classes are set on load --- diff --git a/js/foundation.sticky.js b/js/foundation.sticky.js index 86e39159c..39c0e707a 100644 --- a/js/foundation.sticky.js +++ b/js/foundation.sticky.js @@ -58,7 +58,12 @@ class Sticky { } _this._setSizes(function(){ - _this._calc(false); + var scroll = window.pageYOffset; + _this._calc(false, scroll); + //Unstick the element will ensure that proper classes are set. + if (!_this.isStuck) { + _this._removeSticky((scroll >= _this.topPoint) ? false : true); + } }); _this._events(id.split('-').reverse().join('-')); });