From: Kevin Kirsche Date: Thu, 14 May 2015 23:06:00 +0000 (-0400) Subject: [Close #16441] ScrollSpy requires non-body elements to have height and padding X-Git-Tag: v3.3.5~15^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=962ae5ac2fb9f291ae7c6a60d8c5d0e00323de8d;p=thirdparty%2Fbootstrap.git [Close #16441] ScrollSpy requires non-body elements to have height and padding [Close #16441] ScrollSpy requires non-body elements to have height and padding --- 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.