Skip to content

Commit 1ceab8b

Browse files
committed
Fix: IE10 or lower incorrectly determines the scrollheight of the body. Use document.documentElement for IE. To make this browser agnostic, the maximum scrollheight of both body and documentElement is used.
1 parent 3bcb1cc commit 1ceab8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/scrollspy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
ScrollSpy.prototype.process = function () {
6464
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
65-
var scrollHeight = this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)
65+
var scrollHeight = this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
6666
var maxScroll = scrollHeight - this.$scrollElement.height()
6767
var offsets = this.offsets
6868
var targets = this.targets

0 commit comments

Comments
 (0)