diff --git a/js/foundation.sticky.js b/js/foundation.sticky.js index cfe356ffc2..9724424e6b 100644 --- a/js/foundation.sticky.js +++ b/js/foundation.sticky.js @@ -47,6 +47,10 @@ class Sticky { this.scrollCount = this.options.checkEvery; this.isStuck = false; $(window).one('load.zf.sticky', function(){ + //We calculate the container height to have correct values for anchor points offset calculation. + _this.containerHeight = _this.$element.css("display") == "none" ? 0 : _this.$element[0].getBoundingClientRect().height; + _this.$container.css('height', _this.containerHeight); + _this.elemHeight = _this.containerHeight; if(_this.options.anchor !== ''){ _this.$anchor = $('#' + _this.options.anchor); }else{