0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-10 22:24:19 +01:00

Adjust for Scrollspy offset when calculating maxScroll.

This commit is contained in:
Mike Robinet 2014-05-13 09:57:04 -05:00
parent ceda948372
commit e84b0c0433

View File

@ -69,7 +69,7 @@
ScrollSpy.prototype.process = function () { ScrollSpy.prototype.process = function () {
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
var scrollHeight = this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) 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 offsets = this.offsets
var targets = this.targets var targets = this.targets
var activeTarget = this.activeTarget var activeTarget = this.activeTarget