aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob <[email protected]>2014-03-16 20:24:21 -0700
committerJacob <[email protected]>2014-03-16 20:24:21 -0700
commitfa4379de080df1e628f09f3e5678a4d181684d01 (patch)
tree037a8ce37f70c00b74b607b47aa8c3d3b8a62489
parentead17b7ca6342ceb39b614d7179b9031902ea63f (diff)
parentf7c360d6206a8c5d2393215239649f9234bb600b (diff)
downloadbootstrap-fa4379de080df1e628f09f3e5678a4d181684d01.tar.xz
bootstrap-fa4379de080df1e628f09f3e5678a4d181684d01.zip
Merge pull request #12862 from sultano/patch-1
Fixed flickering and simplified calculations
-rw-r--r--js/affix.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/js/affix.js b/js/affix.js
index 84953c5cd..7d36fff0b 100644
--- a/js/affix.js
+++ b/js/affix.js
@@ -55,8 +55,6 @@
var offsetTop = offset.top
var offsetBottom = offset.bottom
- if (this.affixed == 'top') position.top += scrollTop
-
if (typeof offset != 'object') offsetBottom = offsetTop = offset
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
@@ -84,7 +82,7 @@
.trigger($.Event(affixType.replace('affix', 'affixed')))
if (affix == 'bottom') {
- this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
+ this.$element.offset({ top: position.top })
}
}