aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Robinet <[email protected]>2014-05-13 09:57:04 -0500
committerMike Robinet <[email protected]>2014-05-13 09:57:04 -0500
commite84b0c0433509bde0b42354754372595db523e1f (patch)
treeb17aed634715fed57a404a7888f6cc908b338e84
parentceda9483723fedb04ad6221a32be028cc81c5d4d (diff)
downloadbootstrap-e84b0c0433509bde0b42354754372595db523e1f.tar.xz
bootstrap-e84b0c0433509bde0b42354754372595db523e1f.zip
Adjust for Scrollspy offset when calculating maxScroll.
-rw-r--r--js/scrollspy.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/js/scrollspy.js b/js/scrollspy.js
index 74e016dc9..53e1c48ba 100644
--- a/js/scrollspy.js
+++ b/js/scrollspy.js
@@ -69,7 +69,7 @@
ScrollSpy.prototype.process = function () {
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
var scrollHeight = this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
- var maxScroll = scrollHeight - this.$scrollElement.height()
+ var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
var offsets = this.offsets
var targets = this.targets
var activeTarget = this.activeTarget