0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-20 17:54:23 +01:00

Merge pull request #15900 from kkirsche/patch-5

[Docs—Fixes #15882]Use an ID as the example for Scrollspy
This commit is contained in:
Mark Otto 2015-02-24 16:30:49 -08:00
commit be164f4d1a

View File

@ -75,9 +75,9 @@ body {
} }
{% endhighlight %} {% endhighlight %}
{% highlight html %} {% highlight html %}
<body data-spy="scroll" data-target=".navbar-example"> <body data-spy="scroll" data-target="#navbar-example">
... ...
<div class="navbar-example"> <div id="navbar-example">
<ul class="nav nav-tabs" role="tablist"> <ul class="nav nav-tabs" role="tablist">
... ...
</ul> </ul>
@ -89,7 +89,7 @@ body {
<h3>Via JavaScript</h3> <h3>Via JavaScript</h3>
<p>After adding <code>position: relative;</code> in your CSS, call the scrollspy via JavaScript:</p> <p>After adding <code>position: relative;</code> in your CSS, call the scrollspy via JavaScript:</p>
{% highlight js %} {% highlight js %}
$('body').scrollspy({ target: '.navbar-example' }) $('body').scrollspy({ target: '#navbar-example' })
{% endhighlight %} {% endhighlight %}