1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-28 15:50:01 +02:00

ScrollSpy: make the threshold option configurable (#36750)

* feat(ScrollSpy): make the threshold option configurable
This commit is contained in:
GeoSot
2022-07-28 11:58:28 +03:00
committed by GitHub
parent 90c50ab198
commit db86607c08
3 changed files with 59 additions and 9 deletions

View File

@@ -380,6 +380,8 @@ const scrollSpy = new bootstrap.ScrollSpy(document.body, {
| `rootMargin` | string | `0px 0px -40%` | Intersection Observer [rootMargin](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/rootMargin) valid units, when calculating scroll position. |
| `smoothScroll` | boolean | `false` | Enables smooth scrolling when a user clicks on a link that refers to ScrollSpy observables. |
| `target` | string \| jQuery object \| DOM element | | Specifies element to apply Scrollspy plugin. |
| `threshold` | array | `[0.1, 0.5, 1]` | `IntersectionObserver` [threshold](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver#threshold) valid input, when calculating scroll position.|
{{< /bs-table >}}
{{< callout warning >}}