mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-19 16:54:24 +01:00
Update affix properly on scrollspy speedy scroll to top of page #11310
Fix scrollspy.js so as affix is updated properly when user scrolls fast to top of page. A fix for issue #11310.
This commit is contained in:
parent
aeee718247
commit
ed5dbf1b2b
4
dist/js/bootstrap.js
vendored
4
dist/js/bootstrap.js
vendored
@ -1665,6 +1665,10 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
|
||||
return activeTarget != (i = targets.last()[0]) && this.activate(i)
|
||||
}
|
||||
|
||||
if (activeTarget && scrollTop <= offsets[0]) {
|
||||
return activeTarget != (i = targets.first()[0]) && this.activate(i)
|
||||
}
|
||||
|
||||
for (i = offsets.length; i--;) {
|
||||
activeTarget != targets[i]
|
||||
&& scrollTop >= offsets[i]
|
||||
|
2
dist/js/bootstrap.min.js
vendored
2
dist/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
@ -84,6 +84,10 @@
|
||||
return activeTarget != (i = targets.last()[0]) && this.activate(i)
|
||||
}
|
||||
|
||||
if (activeTarget && scrollTop <= offsets[0]) {
|
||||
return activeTarget != (i = targets.first()[0]) && this.activate(i)
|
||||
}
|
||||
|
||||
for (i = offsets.length; i--;) {
|
||||
activeTarget != targets[i]
|
||||
&& scrollTop >= offsets[i]
|
||||
|
Loading…
x
Reference in New Issue
Block a user