]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fixes PART of #7969, wraps section of initialization function in a window.onLoad...
authorChris Oyler <christopher.oyler@gmail.com>
Mon, 25 Jan 2016 19:13:24 +0000 (11:13 -0800)
committerChris Oyler <christopher.oyler@gmail.com>
Mon, 25 Jan 2016 19:13:24 +0000 (11:13 -0800)
js/foundation.sticky.js

index ebd29b0cb61028bc59f4e116f47179658d09c406..54655d77a255124b8d46cfa038e75932a40884ab 100644 (file)
 
     this.scrollCount = this.options.checkEvery;
     this.isStuck = false;
+    $(window).one('load.zf.sticky', function(){
+      if(_this.options.anchor !== ''){
+        _this.$anchor = $('#' + _this.options.anchor);
+      }else{
+        _this._parsePoints();
+      }
 
-    if(this.options.anchor !== ''){
-      this.$anchor = $('#' + this.options.anchor);
-    }else{
-      this._parsePoints();
-    }
-
-    this._setSizes(function(){
-      _this._calc(false);
+      _this._setSizes(function(){
+        _this._calc(false);
+      });
+      _this._events(id.split('-').reverse().join('-'));
     });
-    this._events(id.split('-').reverse().join('-'));
   };
   /**
    * If using multiple elements as anchors, calculates the top and bottom pixel values the sticky thing should stick and unstick on.