]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
[Close #16441] ScrollSpy requires non-body elements to have height and padding 16484/head
authorKevin Kirsche <Kev.Kirsche+GitHub@gmail.com>
Thu, 14 May 2015 23:06:00 +0000 (19:06 -0400)
committerKevin Kirsche <Kev.Kirsche@gmail.com>
Sat, 30 May 2015 22:24:23 +0000 (18:24 -0400)
[Close #16441] ScrollSpy requires non-body elements to have height and padding

docs/_includes/js/scrollspy.html

index afac356e12e388d10855ab3f90d834e23736ee18..ab23e312aae6d011062b111b35b953864b3c17ea 100644 (file)
@@ -65,7 +65,7 @@
   </div>
 
   <h3>Requires relative positioning</h3>
-  <p>No matter the implementation method, scrollspy requires the use of <code>position: relative;</code> on the element you're spying on. In most cases this is the <code>&lt;body&gt;</code>.</p>
+  <p>No matter the implementation method, scrollspy requires the use of <code>position: relative;</code> on the element you're spying on. In most cases this is the <code>&lt;body&gt;</code>. When scrollspying on elements other than the <code>&lt;body&gt;</code>, be sure to have a <code>height</code> set and <code>overflow-y: scroll;</code> applied.</p>
 
   <h3>Via data attributes</h3>
   <p>To easily add scrollspy behavior to your topbar navigation, add <code>data-spy="scroll"</code> to the element you want to spy on (most typically this would be the <code>&lt;body&gt;</code>). Then add the <code>data-target</code> attribute with the ID or class of the parent element of any Bootstrap <code>.nav</code> component.</p>