aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/scrollspy.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/js/scrollspy.js b/js/scrollspy.js
index 02054bdb8..fecd8a446 100644
--- a/js/scrollspy.js
+++ b/js/scrollspy.js
@@ -74,6 +74,10 @@
return activeTarget != (i = targets.last()[0]) && this.activate(i)
}
+ if (activeTarget && scrollTop <= offsets[0]) {
+ return activeTarget != (i = targets[0]) && this.activate(i)
+ }
+
for (i = offsets.length; i--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]