From 0e876dfef37baf264c56f95079faec915893c3b3 Mon Sep 17 00:00:00 2001 From: "g.chanaud" Date: Sat, 30 Apr 2016 12:41:55 +0200 Subject: [PATCH] [Bugfix] Sticky : Anchored element's not following the flow when resizing the window and going over/behind other elements --- js/foundation.sticky.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/foundation.sticky.js b/js/foundation.sticky.js index cfe356ffc..8055eeb12 100644 --- a/js/foundation.sticky.js +++ b/js/foundation.sticky.js @@ -294,9 +294,14 @@ class Sticky { }); this.elemHeight = newContainerHeight; - if (this.isStuck) { - this.$element.css({"left":this.$container.offset().left + parseInt(comp['padding-left'], 10)}); - } + if (this.isStuck) { + this.$element.css({"left":this.$container.offset().left + parseInt(comp['padding-left'], 10)}); + } else { + if (this.$element.hasClass('is-at-bottom')) { + var anchorPt = (this.points ? this.points[1] - this.$container.offset().top : this.anchorHeight) - this.elemHeight; + this.$element.css('top', anchorPt); + } + } this._setBreakPoints(newContainerHeight, function() { if (cb) { cb(); } -- 2.47.2