Skip to content

Commit 2526c3f

Browse files
committed
Merge pull request twbs#6118 from godric7/master
scrollSpy - add parent scrollTop to offset calculation
2 parents a7eb9c2 + 8b959ca commit 2526c3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/bootstrap-scrollspy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
, $href = /^#\w/.test(href) && $(href)
6060
return ( $href
6161
&& $href.length
62-
&& [[ $href.position().top, href ]] ) || null
62+
&& [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null
6363
})
6464
.sort(function (a, b) { return a[0] - b[0] })
6565
.each(function () {

0 commit comments

Comments
 (0)