aboutsummaryrefslogtreecommitdiff
path: root/docs/docs.html
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2013-04-20 15:32:16 -0700
committerMark Otto <[email protected]>2013-04-20 15:32:16 -0700
commit0c9b161bb889a5f47f7ef0752d90c41c9f957695 (patch)
treebc60e36810e13f627daf8e657230f84313277cc3 /docs/docs.html
parent510c9a6ad87a1148fe59a7b8531d9b9e11b0ae17 (diff)
downloadbootstrap-0c9b161bb889a5f47f7ef0752d90c41c9f957695.tar.xz
bootstrap-0c9b161bb889a5f47f7ef0752d90c41c9f957695.zip
Fixes #7093: more consistent scrollspy docs
Diffstat (limited to 'docs/docs.html')
-rw-r--r--docs/docs.html13
1 files changed, 5 insertions, 8 deletions
diff --git a/docs/docs.html b/docs/docs.html
index dcb379bf0..55e3dfb72 100644
--- a/docs/docs.html
+++ b/docs/docs.html
@@ -5327,7 +5327,7 @@ $('.dropdown-toggle').dropdown()
<h2>Example in navbar</h2>
<p>The ScrollSpy plugin is for automatically updating nav targets based on scroll position. Scroll the area below the navbar and watch the active class change. The dropdown sub items will be highlighted as well.</p>
<div class="bs-docs-example">
- <div id="navbarExample" class="navbar navbar-static">
+ <div id="navbar-example" class="navbar navbar-static">
<div class="navbar-inner">
<div class="container" style="width: auto;">
<a class="navbar-brand" href="#">Project Name</a>
@@ -5347,7 +5347,7 @@ $('.dropdown-toggle').dropdown()
</div>
</div>
</div>
- <div data-spy="scroll" data-target="#navbarExample" data-offset="0" class="scrollspy-example">
+ <div data-spy="scroll" data-target="#navbar-example" data-offset="0" class="scrollspy-example">
<h4 id="fat">@fat</h4>
<p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p>
<h4 id="mdo">@mdo</h4>
@@ -5364,15 +5364,12 @@ $('.dropdown-toggle').dropdown()
</div><!-- /example -->
- <hr class="bs-docs-separator">
-
-
<h2>Usage</h2>
<h3>Via data attributes</h3>
- <p>To easily add scrollspy behavior to your topbar navigation, just add <code>data-spy="scroll"</code> to the element you want to spy on (most typically this would be the body) and <code>data-target=".navbar"</code> to select which nav to use. You'll want to use scrollspy with a <code>.nav</code> component.</p>
+ <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>
{% highlight html linenos %}
-<body data-spy="scroll" data-target=".navbar">
+<body data-spy="scroll" data-target="#navbar-example">
...
</body>
{% endhighlight %}
@@ -5380,7 +5377,7 @@ $('.dropdown-toggle').dropdown()
<h3>Via JavaScript</h3>
<p>Call the scrollspy via JavaScript:</p>
{% highlight js linenos %}
-$('.navbar').scrollspy()
+$('#navbar-example').scrollspy()
{% endhighlight %}
<div class="bs-docs-sidenote">