diff --git a/docs/javascript.html b/docs/javascript.html index 48e07485ad..d3eeeb5c22 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -665,8 +665,16 @@ $('#myDropdown').on('show.bs.dropdown', function () {
No matter the implementation method, scrollspy requires the use of position: absolute;
on the element you're spying on. In most cases this is the <body>
.
To easily add scrollspy behavior to your topbar navigation, add data-spy="scroll"
to the element you want to spy on (most typically this would be the <body>
). Then add the data-target
attribute with the ID or class of the parent element of any Bootstrap .nav
component.
Call the scrollspy via JavaScript:
+After adding position: relative;
in your CSS, call the scrollspy via JavaScript: