diff --git a/js/affix.js b/js/affix.js index 2fbafc6a8e..94d3cc224c 100644 --- a/js/affix.js +++ b/js/affix.js @@ -57,8 +57,8 @@ if (this.affixed == 'top') position.top += scrollTop if (typeof offset != 'object') offsetBottom = offsetTop = offset - if (typeof offsetTop == 'function') offsetTop = offset.top() - if (typeof offsetBottom == 'function') offsetBottom = offset.bottom() + if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) + if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :