aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuleman Chikhalia <[email protected]>2014-02-27 00:39:46 -0800
committerSuleman Chikhalia <[email protected]>2014-02-27 00:39:46 -0800
commitf7c360d6206a8c5d2393215239649f9234bb600b (patch)
tree7fa9117bc5eb2202b6422f8890d10a0c3b742444
parent1e06cdff2f6eddbe8392ce7ac6e93c321e293804 (diff)
downloadbootstrap-f7c360d6206a8c5d2393215239649f9234bb600b.tar.xz
bootstrap-f7c360d6206a8c5d2393215239649f9234bb600b.zip
Fixed flickering and simplified calculations
- Removed offending line causing a flicker to the default top state - Simplified calculation of the top offset when in the bottom state
-rw-r--r--js/affix.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/js/affix.js b/js/affix.js
index 05c909e16..60613b611 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 })
}
}