From 962ae5ac2fb9f291ae7c6a60d8c5d0e00323de8d Mon Sep 17 00:00:00 2001 From: Kevin Kirsche Date: Thu, 14 May 2015 19:06:00 -0400 Subject: [PATCH] [Close #16441] ScrollSpy requires non-body elements to have height and padding [Close #16441] ScrollSpy requires non-body elements to have height and padding --- docs/_includes/js/scrollspy.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_includes/js/scrollspy.html b/docs/_includes/js/scrollspy.html index afac356e12..ab23e312aa 100644 --- a/docs/_includes/js/scrollspy.html +++ b/docs/_includes/js/scrollspy.html @@ -65,7 +65,7 @@

Requires relative positioning

-

No matter the implementation method, scrollspy requires the use of position: relative; on the element you're spying on. In most cases this is the <body>.

+

No matter the implementation method, scrollspy requires the use of position: relative; on the element you're spying on. In most cases this is the <body>. When scrollspying on elements other than the <body>, be sure to have a height set and overflow-y: scroll; applied.

Via data attributes

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.